mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04: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:
parent
82f0488f77
commit
b5606f5e81
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user