Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile warnings #37

Open
AndrewMcW opened this issue Jan 14, 2024 · 0 comments
Open

Compile warnings #37

AndrewMcW opened this issue Jan 14, 2024 · 0 comments

Comments

@AndrewMcW
Copy link

When I do the first compile of a new project (or Clean then compile), I receive several warnings.

None of these warning appear to be anything serious and the project works fine - it's really just cosmetic.

The first two warning relate to the redefinition af the labs macro:

lib\TM1637TinyDisplay\TM1637TinyDisplay.cpp:32:0: warning: "labs" redefined
 #define labs(x) ((x)>0?(x):-(x))

In file included from lib\TM1637TinyDisplay\TM1637TinyDisplay.cpp:24:0:
c:\users\andre\.platformio\packages\toolchain-atmelavr\avr\include\stdlib.h:132:0: note: this is the location of the previous definition
 #define labs(__i) __builtin_labs(__i)

lib\TM1637TinyDisplay\TM1637TinyDisplay6.cpp:32:0: warning: "labs" redefined
 #define labs(x) ((x)>0?(x):-(x))

In file included from lib\TM1637TinyDisplay\TM1637TinyDisplay6.cpp:24:0:
c:\users\andre\.platformio\packages\toolchain-atmelavr\avr\include\stdlib.h:132:0: note: this is the location of the previous definition
 #define labs(__i) __builtin_labs(__i)

The second group of warnings are all int/unsigned int mismatch in for loops:

lib\TM1637TinyDisplay\TM1637TinyDisplay.cpp: In member function 'void TM1637TinyDisplay::showString(const char*, uint8_t, uint8_t, uint8_t)':
lib\TM1637TinyDisplay\TM1637TinyDisplay.cpp:432:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int x = 0; x < strlen(s); x++) {
                     ~~^~~~~~~~~~~
lib\TM1637TinyDisplay\TM1637TinyDisplay.cpp: In member function 'void TM1637TinyDisplay::showString_P(const char*, uint8_t, uint8_t, uint8_t)':
lib\TM1637TinyDisplay\TM1637TinyDisplay.cpp:483:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int x = 0; x < strlen_P(s); x++) {
                     ~~^~~~~~~~~~~~~
lib\TM1637TinyDisplay\TM1637TinyDisplay.cpp: In member function 'bool TM1637TinyDisplay::Animate(bool)':
lib\TM1637TinyDisplay\TM1637TinyDisplay.cpp:614:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 if (offset >= 0 && offset < m_animation_frames - (2 * MAXDIGITS)) {
                                    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib\TM1637TinyDisplay\TM1637TinyDisplay.cpp:625:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 if (offset >= 0 && offset < m_animation_frames - (2 * MAXDIGITS)) {
                                    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling .pio\build\attiny84_via_arduino_ISP\FrameworkArduino\HardwareSerial.cpp.o
lib\TM1637TinyDisplay\TM1637TinyDisplay6.cpp: In member function 'void TM1637TinyDisplay6::showString(const char*, uint8_t, uint8_t, uint8_t)':
lib\TM1637TinyDisplay\TM1637TinyDisplay6.cpp:435:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int x = 0; x < strlen(s); x++) {
                     ~~^~~~~~~~~~~
lib\TM1637TinyDisplay\TM1637TinyDisplay6.cpp: In member function 'void TM1637TinyDisplay6::showString_P(const char*, uint8_t, uint8_t, uint8_t)':
lib\TM1637TinyDisplay\TM1637TinyDisplay6.cpp:486:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int x = 0; x < strlen_P(s); x++) {
                     ~~^~~~~~~~~~~~~
lib\TM1637TinyDisplay\TM1637TinyDisplay6.cpp: In member function 'bool TM1637TinyDisplay6::Animate(bool)':
lib\TM1637TinyDisplay\TM1637TinyDisplay6.cpp:617:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 if (offset >= 0 && offset < m_animation_frames - (2 * MAXDIGITS)) {
                                    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib\TM1637TinyDisplay\TM1637TinyDisplay6.cpp:628:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
                 if (offset >= 0 && offset < m_animation_frames - (2 * MAXDIGITS)) {

System configuration:
Using VS Code (1.85.1 date 2023-12-13)
PlatformIO (v3.3.2)
Windows 10 home v 10.0.19045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant