ChipChop Support Forum
Log in
Log out
Join the forum
My Details
REPLIES: 3
VIEWS: 231
BACK
REPLY TO THIS POST
Simco23
16 Mar 2024
compilation warning?
Any idea why I am getting these compiler warnings.




Compiling .pio/build/esp-wrover-kit/FrameworkArduino/esp32-hal-uart.c.o
.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.c: In function 'uartSetPins':
.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.c:153:9: warning: 'return' with no value, in function returning non-void
return;
^~~~~~
.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-uart.c:149:6: note: declared here
bool uartSetPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin)



The code compiles fine but it's so annoying, makes me jump every time! 🙀 I must have done something stupid, make it stop please!

thnx
pixie dust
19 Mar 2024

what I've done is to hold the command button and click on that line that says "...esp32-hal-uart.c" (it goes yellow underline when you hover over it), that get's you in the .c file on the offending line and where it says "return" just make it "return 0", it's expecting a return value and as that is a fail condition I've just told it to return false.
Simco23
20 Mar 2024

That worked! Thank you!

I didn't know you can access the espressif source code, I was convinced it was a complied binary. Does that mean you can tweak the sdk and the changes will be included with any future compile? That would be super cool.
pixie dust
20 Mar 2024

Those are I think the arduino framework libs so the compiler picks only what you specify in the #include otherwise if everything was a single binary it would be huge and you would be loading 99.999% of unnecessary stuff (probably wouldn't even fit)
I use these little edits mostly for debugging so you can patch directly inside some of these .c .cpp functions and see on a slightly deeper level what's going on, saved my backside few times.

Just remember that if you tweak stuff there it will be lost on every new idf release so make notes what you change so you can replicate it again but sometimes if there is a big change you may not be able to, this annoying little bug will probably disappear in the next update anyway