Page 1 of 1

Conflicting declarations for void vApplicationStackOverflowHook( )

Posted: Sat May 23, 2026 2:06 pm
by BrianP
Hello and thanks for the help.

I would like to create a custom configCHECK_FOR_STACK_OVERFLOW() routine but run into a problem.

This is my code

#include "freertos/FreeRTOS.h"
#include <esp_task_wdt.h>

void Restart( char * reason );

#define checkconfigCHECK_FOR_STACK_OVERFLOW configCHECK_FOR_STACK_OVERFLOW

void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName ) {
char logmessage[100];
snprintf(logmessage, sizeof( logmessage ), "Stack overflow %s", pcTaskName);
Restart( logmessage );
}


But I get an error

~~~~~~~~~~~~~~~~~~~~
In file included from C:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/esp_additions/include/freertos/idf_additions.h:20,
from C:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h:1533,
from C:/Users/bjpic/Documents/VSCWork/Bee Controller/main/Panic.c:1:
C:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/FreeRTOS-Kernel/include/freertos/task.h:1601:10: note: previous declaration of 'vApplicationStackOverflowHook' with type 'void(struct tskTaskControlBlock *, char *)'
1601 | void vApplicationStackOverflowHook( TaskHandle_t xTask,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.


In the esp configuration and FreeRTOSConfig.h configCHECK_FOR_STACK_OVERFLOW is set to 2, and my source file sees this, however, when I use VSCode to look at the at the declaration of vApplicationStackOverflowHook() in my source file it refers back to

"C:\Espressif\frameworks\esp-idf-v5.5.3\components\freertos\FreeRTOS-Kernel-SMP\include\freertos\task.h" where configCHECK_FOR_STACK_OVERFLOW is sets to 0. This is because the header file FreeRTOS.h thinks configCHECK_FOR_STACK_OVERFLOW is undefined.

#ifndef configCHECK_FOR_STACK_OVERFLOW
#define configCHECK_FOR_STACK_OVERFLOW 0
#endif


Somehow, even though configCHECK_FOR_STACK_OVERFLOW is set to 2 in the source, the compiler is picking up a header file which doesn't have the proper setting.


I don't understand what is going on. Thanks

ps: I am using 5.5.3 because I have never been able to compile using 6 under VSC, despite EIM claiming it has installed everything. I will work on that issue in the future.

Re: Conflicting declarations for void vApplicationStackOverflowHook( )

Posted: Sat May 23, 2026 7:55 pm
by MicroController
But I get an error

~~~~~~~~~~~~~~~~~~~~
...
There should be more output actually telling you what error.
Somehow, even though configCHECK_FOR_STACK_OVERFLOW is set to 2 in the source, the compiler is picking up a header file which doesn't have the proper setting.
It's actually only VSCode that's "guessing" wrong here; the compiler uses the correct header file ("FreeRTOSConfig.h" actually). (Notice that you're building with the normal "FreeRTOS-Kernel" but the header file you're shown is from the SMP variant "FreeRTOS-Kernel-SMP".)

Re: Conflicting declarations for void vApplicationStackOverflowHook( )

Posted: Sun May 24, 2026 2:57 am
by BrianP
MicroController thank you for the reply.

I don't understand this part though

It's actually only VSCode that's "guessing" wrong here; the compiler uses the correct header file ("FreeRTOSConfig.h" actually). (Notice that you're building with the normal "FreeRTOS-Kernel" but the header file you're shown is from the SMP variant "FreeRTOS-Kernel-SMP".)

It seems the build system is mixing up the header files? I have no hands on this - ESP-IDF Extension seems to be mixing up the headers. Is there a setting somewhere that I am missing?

Thanks.


This is the full text of the compiler error


* Executing task: C:\Espressif\tools\ninja\1.12.1\ninja.EXE

[1/16] Performing build step for 'ulp_main'
ninja: no work to do.
[5/13] Performing build step for 'bootloader'
[1/1] C:\windows\system32\cmd.exe /C "cd /D "C:\Users\bjpic\Documents\VSCWork\Bee Controller\build\bootloader\esp-idf\esptool_py" && C:\Espressif\python_env\idf5.5_py3.11_env\Scripts\python.exe C:/Espressif/frameworks/esp-idf-v5.5.3/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x0 "C:/Users/bjpic/Documents/VSCWork/Bee Controller/build/bootloader/bootloader.bin""
Bootloader binary size 0x5160 bytes. 0x2ea0 bytes (36%) free.
[8/13] Building C object esp-idf/main/CMakeFiles/__idf_main.dir/Panic.c.obj
FAILED: esp-idf/main/CMakeFiles/__idf_main.dir/Panic.c.obj
C:\Espressif\tools\xtensa-esp-elf\esp-14.2.0_20251107\xtensa-esp-elf\bin\xtensa-esp32s3-elf-gcc.exe -DESP_MDNS_VERSION_NUMBER=\"1.11.1\" -DESP_PLATFORM -DIDF_VER=\"v5.5.3\" -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -DUNITY_INCLUDE_CONFIG_H -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I"C:/Users/bjpic/Documents/VSCWork/Bee Controller/build/config" -I"C:/Users/bjpic/Documents/VSCWork/Bee Controller/main/include" -I"C:/Users/bjpic/Documents/VSCWork/Bee Controller/build/esp-idf/main/ulp_main" -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/newlib/platform_include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/config/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/config/include/freertos -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/config/xtensa/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/FreeRTOS-Kernel/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/esp_additions/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/include/soc -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/include/soc/esp32s3 -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/dma/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/ldo/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/debug_probe/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/mspi_timing_tuning/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/mspi_timing_tuning/tuning_scheme_impl/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/power_supply/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/port/esp32s3/. -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/port/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/mspi_timing_tuning/port/esp32s3/. -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hw_support/mspi_timing_tuning/port/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/heap/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/heap/tlsf -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/log/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/soc/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/soc/esp32s3 -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/soc/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/soc/esp32s3/register -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/hal/platform_port/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/hal/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/hal/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_rom/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_rom/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_rom/esp32s3/include/esp32s3 -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_rom/esp32s3 -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_common/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_system/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_system/port/soc -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_system/port/include/private -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/xtensa/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/xtensa/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/xtensa/deprecated_include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/lwip/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/lwip/include/apps -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/lwip/include/apps/sntp -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/lwip/lwip/src/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/lwip/port/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/lwip/port/freertos/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/lwip/port/esp32xx/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/lwip/port/esp32xx/include/arch -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/lwip/port/esp32xx/include/sys -I"C:/Users/bjpic/Documents/VSCWork/Bee Controller/managed_components/esp-idf-lib__esp_idf_lib_helpers" -I"C:/Users/bjpic/Documents/VSCWork/Bee Controller/managed_components/espressif__aht20/include" -I"C:/Users/bjpic/Documents/VSCWork/Bee Controller/managed_components/espressif__i2c_bus/include" -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_i2c/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/driver/deprecated -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/driver/i2c/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/driver/touch_sensor/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/driver/twai/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/driver/touch_sensor/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_pm/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_ringbuf/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_gpio/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_pcnt/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_gptimer/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_spi/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_mcpwm/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_ana_cmpr/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_i2s/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_sdmmc/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/sdmmc/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_sdspi/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_sdio/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_dac/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_rmt/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_tsens/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_sdm/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_uart/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/vfs/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_ledc/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_parlio/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_usb_serial_jtag/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_twai/include -I"C:/Users/bjpic/Documents/VSCWork/Bee Controller/managed_components/espressif__mdns/include" -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/console -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_vfs_console/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_netif/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_event/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/mbedtls/port/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/mbedtls/mbedtls/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/mbedtls/mbedtls/library -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/mbedtls/esp_crt_bundle/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/mbedtls/mbedtls/3rdparty/everest/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/mbedtls/mbedtls/3rdparty/p256-m -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/mbedtls/mbedtls/3rdparty/p256-m/p256-m -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_app_format/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_bootloader_format/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/app_update/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/bootloader_support/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/bootloader_support/bootloader_flash/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_partition/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/efuse/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/efuse/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_mm/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/spi_flash/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_security/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/pthread/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_timer/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_psram/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_psram/xip_impl/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/app_trace/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/nvs_flash/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_phy/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_phy/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/wpa_supplicant/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/wpa_supplicant/port/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/wpa_supplicant/esp_supplicant/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_coex/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_wifi/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_wifi/include/local -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_wifi/wifi_apps/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_wifi/wifi_apps/nan_app/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_gdbstub/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/unity/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/unity/unity/src -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/cmock/CMock/src -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_bitscrambler/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/http_parser -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp-tls -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp-tls/esp-tls-crypto -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_adc/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_adc/interface -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_adc/esp32s3/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_adc/deprecated/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_isp/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_cam/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_cam/interface -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_cam/dvp/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_jpeg/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_ppa/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_touch_sens/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_driver_touch_sens/hw_ver2/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_eth/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hal_ieee802154/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_hid/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/tcp_transport/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_http_client/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_http_server/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_https_ota/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_https_server/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_lcd/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_lcd/interface -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_lcd/rgb/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/protobuf-c/protobuf-c -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/protocomm/include/common -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/protocomm/include/security -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/protocomm/include/transports -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/protocomm/include/crypto/srp6a -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/protocomm/proto-c -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/esp_local_ctrl/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/espcoredump/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/espcoredump/include/port/xtensa -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/wear_levelling/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/fatfs/diskio -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/fatfs/src -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/fatfs/vfs -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/idf_test/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/idf_test/include/esp32s3 -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/ieee802154/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/json/cJSON -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/mqtt/esp-mqtt/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/nvs_sec_provider/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/perfmon/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/rt/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/spiffs/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/touch_element/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/ulp/ulp_common/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/ulp/ulp_riscv/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/ulp/ulp_riscv/shared/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/usb/include -IC:/Espressif/frameworks/esp-idf-v5.5.3/components/wifi_provisioning/include -mlongcalls -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -fdiagnostics-color=always -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-error=extra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -mdisable-hardware-atomics -Og -fno-shrink-wrap "-fmacro-prefix-map=C:/Users/bjpic/Documents/VSCWork/Bee Controller=." -fmacro-prefix-map=C:/Espressif/frameworks/esp-idf-v5.5.3=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -std=gnu17 -Wno-old-style-declaration -DAHT20_VER_MAJOR=2 -DAHT20_VER_MINOR=0 -DAHT20_VER_PATCH=0 -DI2C_BUS_VER_MAJOR=1 -DI2C_BUS_VER_MINOR=5 -DI2C_BUS_VER_PATCH=1 -MD -MT esp-idf/main/CMakeFiles/__idf_main.dir/Panic.c.obj -MF esp-idf\main\CMakeFiles\__idf_main.dir\Panic.c.obj.d -o esp-idf/main/CMakeFiles/__idf_main.dir/Panic.c.obj -c "C:/Users/bjpic/Documents/VSCWork/Bee Controller/main/Panic.c"
C:/Users/bjpic/Documents/VSCWork/Bee Controller/main/Panic.c:12:6: error: conflicting types for 'vApplicationStackOverflowHook'; have 'void(struct tskTaskControlBlock *, signed char *)'
12 | void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName ) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/esp_additions/include/freertos/idf_additions.h:20,
from C:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/FreeRTOS-Kernel/include/freertos/FreeRTOS.h:1533,
from C:/Users/bjpic/Documents/VSCWork/Bee Controller/main/Panic.c:1:
C:/Espressif/frameworks/esp-idf-v5.5.3/components/freertos/FreeRTOS-Kernel/include/freertos/task.h:1601:10: note: previous declaration of 'vApplicationStackOverflowHook' with type 'void(struct tskTaskControlBlock *, char *)'
1601 | void vApplicationStackOverflowHook( TaskHandle_t xTask,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

* The terminal process "C:\Espressif\tools\ninja\1.12.1\ninja.EXE" terminated with exit code: 1.

Re: Conflicting declarations for void vApplicationStackOverflowHook( )

Posted: Sun May 24, 2026 7:47 am
by MicroController
It seems the build system is mixing up the header files?
The thing is that the actual build system (cmake,ninja,gcc,...) determine and use the 'actual' include paths, while VSCode (the IDE) and its IntelliSense plugin go about it in a heuristic way, trying to find and show you "the" definition of a macro - and when multiple files seem to define the macro, VSCode "guesses" which definition is relevant, which more often than not takes you to the wrong location/definition.

This is the full text of the compiler error

Code: Select all

conflicting types for 'vApplicationStackOverflowHook'; have 'void(struct tskTaskControlBlock *, signed char *)'
...
task.h:1601:10: note: previous declaration of 'vApplicationStackOverflowHook' with type 'void(struct tskTaskControlBlock *, char *)'
Hmm. The only visible difference is "signed char*" vs. "char*" - try changing your function to char* first. And you should also #include "freertos/task.h" which typedef's TaskHandle_t.

(Apparently, although char is signed, "'signed char' is not the same as 'char'" (godbolt). Go figure.)

Re: Conflicting declarations for void vApplicationStackOverflowHook( )

Posted: Sun May 24, 2026 1:08 pm
by BrianP
Thanks again for your help! That was it: removing the signed from signed char.

For some reason I thought it might have been the first argument (TaskHandle_t xTask vs struct tskTaskControlBlock *) and changed that but totally missed the signed char vs char.

Since I was working on code copied from a (presumably) working example it never occurred to me the function definition itself was the problem.

So now it compiles.

Thanks again.

Still weird about the different header files though ...

Re: Conflicting declarations for void vApplicationStackOverflowHook( )

Posted: Mon May 25, 2026 2:00 pm
by MicroController
It turns out that the C standard mandates that "signed char", "unsigned char", and "char" are three different types.
The signedness of "char" is "implementation-defined"/platform-dependent, so depending on the compiler and target it may be either signed or unsigned; that's why the signedness of "signed char" is signed, of "unsigned char" is unsigned, and "char"'s is basically undefined, and "char" is never the same type as either "signed char" or "unsigned char".
"[signed/unsigned] char" being integer types may be implicitly convertible to each other, but not pointers to "[signed/unsigned] char".

Re: Conflicting declarations for void vApplicationStackOverflowHook( )

Posted: Mon May 25, 2026 2:09 pm
by BrianP
Well, that kinda makes sense. No point in having types which are equivalent unless explicitly defined as such.

I feel embarrassed I didn't spot it but I was consumed by the pursuit of different header files and, naturally, assumed example code replicated broadly across the interwebs would actually compile :D

Re: Conflicting declarations for void vApplicationStackOverflowHook( )

Posted: Mon May 25, 2026 2:20 pm
by MicroController
I did notice it the first time around, but quickly disregarded it because I was of the belief that "char" == "signed char" - And now I learned something fundamental I didn't know for many years of dabbling in C. Kinda embarrasing too ;)
OTOH, we "embedded guys" never use signed or unsigned char but only (u)int8_t, right? :)