From a52b9c40a1c51a643e31bd6e62c81fc5fa71502b Mon Sep 17 00:00:00 2001 From: Shadi Ramadan Date: Sun, 21 Sep 2025 13:58:07 -0600 Subject: [PATCH] [clang support] Change pointer type to volatile in utils crash handler Without the volatile keyword clang complains- volatile ensures this statement is not optimized out. My builds succeed after this change. espressif__esp_hosted/common/utils/esp_hosted_cli.c:203:2: error: indirection of non-volatile null pointer will be deleted, not trap [-Werror,-Wnull-dereference] 203 | *(int *) (0x0) = 0; --- esp_hosted_fg/common/utils/esp_hosted_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp_hosted_fg/common/utils/esp_hosted_cli.c b/esp_hosted_fg/common/utils/esp_hosted_cli.c index 232bbffe8e..6cfeaa25ce 100644 --- a/esp_hosted_fg/common/utils/esp_hosted_cli.c +++ b/esp_hosted_fg/common/utils/esp_hosted_cli.c @@ -194,7 +194,7 @@ static int crash_device_handler(int argc, char** argv) printf("Crashing the device now...\n"); // Writing at invalid address - *(int *) (0x0) = 0; + *(volatile int *) (0x0) = 0; return ESP_OK; }