mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-03 04:34:31 +02:00
esp_system: make the abort operation compatible with clang
Clang warns that the original code wouldn't have any effect: warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference] note: consider using __builtin_trap() or qualifying pointer with 'volatile' __builtin_trap translates to 'break 1, 15' instruction on Xtensa, which might be okay in this case. However to absolutely certainly not break anything for GCC builds, add 'volatile' instead.
This commit is contained in:
@@ -399,7 +399,7 @@ void IRAM_ATTR __attribute__((noreturn, no_sanitize_undefined)) panic_abort(cons
|
||||
#endif
|
||||
#endif
|
||||
|
||||
*((int *) 0) = 0; // NOLINT(clang-analyzer-core.NullDereference) should be an invalid operation on targets
|
||||
*((volatile int *) 0) = 0; // NOLINT(clang-analyzer-core.NullDereference) should be an invalid operation on targets
|
||||
while (1);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user