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:
Ivan Grokhotkov 2021-09-10 19:29:05 +02:00
parent 82f0488f77
commit b5606f5e81

View File

@ -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);
}