mstrens / grbl_controller_esp32

grbl controller for esp32
174 stars 76 forks source link

Fix all fatal compilation errors with compiler warnings set to all in… #21

Closed PhiJu5 closed 3 years ago

PhiJu5 commented 3 years ago

… preferences

Fix all compilation errors when all warnings set:

1) menu_file.cpp: In function 'void closeAllFiles()': menu_file.cpp:364:10: error: statement has no effect [-Werror=unused-value] for (i ; i < DIR_LEVEL_MAX ; i++ ) { ^exit status 1 statement has no effect [-Werror=unused-value]

2) nunchuk.cpp: In function 'void handleNunchuk()': nunchuk.cpp:183:70: error: suggest parentheses around '&&' within '||' [-Werror=parentheses] if ( (machineStatus[0] == 'J' || machineStatus[0] == 'I' ) && ( ( prevMoveX != moveX) || ( prevMoveY != moveY) || ( prevMoveZ != moveZ) ) || ( prevMoveA != moveA) ) { // cancel Jog if jogging and at least one direction change

cc1plus.exe: some warnings being treated as errors exit status 1 suggest parentheses around '&&' within '||' [-Werror=parentheses]

3) TFT_eSPI.cpp: In member function 'void TFT_eSPI::pushImage(int32_t, int32_t, uint32_t, uint32_t, uint8_t, bool)': TFT_eSPI.cpp:1246:15: error: value computed is not used [-Werror=unused-value] ptr++; ^ TFT_eSPI.cpp: In member function 'void TFT_eSPI::pushImage(int32_t, int32_t, uint32_t, uint32_t, uint8_t, uint8_t, bool)': TFT_eSPI.cpp:1395:15: error: value computed is not used [-Werror=unused-value] ptr++; ^ cc1plus.exe: some warnings being treated as errors exit status 1 Error compiling for board ESP32 Dev Module.

p++ is going to be grouped as (p++), so not used as uint8_t* ptr = data lines can be removed.

mstrens commented 3 years ago

Thanks for your corrections. I merged the pull request.