nopnop2002 / Raspberry-ili9325

Parallel TFT Shield Library for wiringPi
64 stars 14 forks source link

Compile error's with options -Wall -Werror #25

Closed vanvught closed 3 years ago

vanvught commented 6 years ago
src/ili9340.c:659:25: error: & has lower precedence than ==; == will be evaluated first [-Werror,-Wparentheses]
        if (h == (ph-2) & _FONT_UNDER_LINE_)
            ~~~~~~~~~~~~^
src/ili9340.c:659:25: note: place parentheses around the '==' expression to silence this warning
        if (h == (ph-2) & _FONT_UNDER_LINE_)
                        ^
            (          )
src/ili9340.c:659:25: note: place parentheses around the & expression to evaluate it first
        if (h == (ph-2) & _FONT_UNDER_LINE_)
                        ^
                 (                         )
src/ili9340.c:661:25: error: & has lower precedence than ==; == will be evaluated first [-Werror,-Wparentheses]
        if (h == (ph-1) & _FONT_UNDER_LINE_)
            ~~~~~~~~~~~~^
src/ili9340.c:661:25: note: place parentheses around the '==' expression to silence this warning
        if (h == (ph-1) & _FONT_UNDER_LINE_)
                        ^
            (          )
src/ili9340.c:661:25: note: place parentheses around the & expression to evaluate it first
        if (h == (ph-1) & _FONT_UNDER_LINE_)
                        ^
                 (                         )
src/ili9340.c:626:14: error: variable 'yss' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
  } else if (_FONT_DIRECTION_ == 3) {
             ^~~~~~~~~~~~~~~~~~~~~
src/ili9340.c:641:8: note: uninitialized use occurs here
  yy = yss;
       ^~~
src/ili9340.c:626:10: note: remove the 'if' if its condition is always true
  } else if (_FONT_DIRECTION_ == 3) {
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ili9340.c:593:20: note: initialize the variable 'yss' to silence this warning
  uint16_t xss, yss;
                   ^
                    = 0
src/ili9340.c:626:14: error: variable 'xss' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
  } else if (_FONT_DIRECTION_ == 3) {
             ^~~~~~~~~~~~~~~~~~~~~
src/ili9340.c:642:8: note: uninitialized use occurs here
  xx = xss;
       ^~~
src/ili9340.c:626:10: note: remove the 'if' if its condition is always true
  } else if (_FONT_DIRECTION_ == 3) {
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
src/ili9340.c:593:15: note: initialize the variable 'xss' to silence this warning
  uint16_t xss, yss;
              ^
               = 0
src/ili9340.c:702:35: error: passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types with different sign [-Werror,-Wpointer-sign]
  spos = String2SJIS(utfs, strlen(utfs), sjis, 64);
                                  ^~~~
/usr/include/string.h:82:28: note: passing argument to parameter '__s' here
size_t   strlen(const char *__s);
                            ^
src/ili9340.c:719:1: error: control may reach end of non-void function [-Werror,-Wreturn-type]
}
^
6 errors generated.
nopnop2002 commented 6 years ago

Thank you for your report. I fixed.

vanvught commented 6 years ago

@nopnop2002 Thank you. However, I made a mistake with opening an issue. The issue is for ili9340.c https://github.com/nopnop2002/ili9340spi_rpi I have opened https://github.com/nopnop2002/ili9340spi_rpi/issues/15 accordingly. My apologize .

nopnop2002 commented 6 years ago

No problem. I'm thankful for your report.