mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
doc: fatal-errors: note on missing returns and IllegalInstruction
In C++ code it is considered to be undefined behavior to exit a non-void function without returning a value. Normally this is detected by the compiler, but users could disable relevant warnings. Add a note about this possibility. See https://github.com/espressif/esp-idf/issues/8244 for context.
This commit is contained in:
parent
39f2b8a28b
commit
31310d46e7
@ -306,6 +306,8 @@ This CPU exception indicates that the instruction which was executed was not a v
|
||||
|
||||
- Some external device has accidentally been connected to the SPI flash pins, and has interfered with communication between {IDF_TARGET_NAME} and SPI flash.
|
||||
|
||||
- In C++ code, exiting from a non-void function without returning a value is considered to be an undefined behavior. When optimizations are enabled, the compiler will often omit the epilogue in such functions. This most often results in an |ILLEGAL_INSTR_MSG| exception. By default, ESP-IDF build system enables ``-Werror=return-type`` which means that missing return statements are treated as compile time errors. However if the application project disables compiler warnings, this issue might go undetected and the |ILLEGAL_INSTR_MSG| exception will occur at run time.
|
||||
|
||||
.. only:: CONFIG_IDF_TARGET_ARCH_XTENSA
|
||||
|
||||
InstrFetchProhibited
|
||||
|
Loading…
x
Reference in New Issue
Block a user