Appended CFlags does not take effect

Hi there,

I’m having a big project, having its framework = espidf. However the compiler have strict default flags.

Have added -Wno-pointer-sign to build_flags section. Which is meant only for C/ObjC, therefore had lots of this warning, but completed the compilation process successfully:

cc1plus.exe: warning: command-line option '-Wno-pointer-sign' is valid for C/ObjC but not for C++.

Decided to use advanced scripting, therefore commented the line above and inserted extra_scripts = scripts/build_flags.py

While scripts/build_flags.py:

Import("env")

env.Append(CFLAGS=["-Wno-pointer-sign"])

But had the error which is:

.pio/libdeps/esp32s3-devkitc/AEAD_OCB/test.c:81:24: error: pointer targets in passing argument 2 of 'hex2bin' differ in signedness [-Werror=pointer-sign]

I’ve made sure it calls my scripting file by putting a debug prints. And made sure that -Wno-pointer-sign is absent by a verbose build.

Had I missed something?

Open a CLI and do pio run -v. What is the full compiler command used for the test.c file?

Here’s it:

xtensa-esp32s3-elf-gcc -o .pio/build/esp32s3-devkitc/libd60/AEAD_OCB/test.o -c -Os -Wall -Werror=all -Wextra -Wno-enum-conversion -Wno-error=deprecated-declarations -Wno-error=unused-but-set-variable -Wno-error=unused-function -Wno-error=unused-variable -Wno-format-nonliteral -Wno-format-security -Wno-old-style-declaration -Wno-sign-compare -Wno-unused-parameter -fdata-sections -ffunction-sections -fmacro-prefix-map=C:/Users/Hamza/.platformio/packages/framework-espidf=/IDF -fmacro-prefix-map=E:/Projects/Teqana/Industrial/Software/Device=. -fno-builtin-bzero -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-stpcpy -fno-builtin-strncpy -fno-jump-tables -fno-tree-switch-conversion -freorder-blocks -fstrict-volatile-bitfields -gdwarf-4 -ggdb -mlongcalls -std=gnu17 -fexceptions -Wno-format -Wno-parentheses -Wno-misleading-indentation -DESP32=ESP32 -DARDUINO_VARIANT=\"esp32s3\" -DARDUINO_BOARD=\"ESP32S3_DEV\" -DARDUINO_ARCH_ESP32 -DARDUINO_ESP32S3_DEV -DARDUINO=10812 -DCHIP_HAVE_CONFIG_H -D_POSIX_READER_WRITER_LOCKS -D_GNU_SOURCE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -DUNITY_INCLUDE_CONFIG_H -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSERIAL_FLASHER_RESET_HOLD_TIME_MS=100 -DSERIAL_FLASHER_BOOT_HOLD_TIME_MS=50 -DMD5_ENABLED=1 -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DIDF_VER=\"5.3.1\" -DESP_PLATFORM -DPLATFORMIO=60115 -DARDUINO_ESP32S3_DEV -DARDUINO_USB_MODE=1 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DEMBEDDED_PLATFORM=1 -DLWIP_ALTCP=1 -DLWIP_ALTCP_TLS=1 -DLWIP_ALTCP_TLS_MBEDTLS=1 -DBOARD_HAS_PSRAM -I.pio/libdeps/esp32s3-devkitc/AEAD_OCB -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/xtensa/esp32s3/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/xtensa/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/xtensa/deprecated_include -I.pio/build/esp32s3-devkitc/config -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/newlib/platform_include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/freertos/config/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/freertos/config/include/freertos -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/freertos/config/xtensa/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/freertos/esp_additions/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_hw_support/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_hw_support/include/soc -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_hw_support/include/soc/esp32s3 -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_hw_support/dma/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_hw_support/ldo/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_hw_support/port/esp32s3 -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_hw_support/port/esp32s3/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/heap/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/log/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/soc/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/soc/esp32s3 -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/soc/esp32s3/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/hal/platform_port/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/hal/esp32s3/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/hal/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_rom/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_rom/include/esp32s3 -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_rom/esp32s3 -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_common/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_system/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_system/port/soc -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_system/port/include/private -Icomponents/lwip/include -Icomponents/lwip/include/apps -Icomponents/lwip/include/apps/sntp -Icomponents/lwip/lwip/src/include -Icomponents/lwip/port/include -Icomponents/lwip/port/freertos/include -Icomponents/lwip/port/esp32xx/include -Icomponents/lwip/port/esp32xx/include/arch -Icomponents/lwip/port/esp32xx/include/sys -Icomponents/lwip/lwip/src/apps/altcp_tls -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_gpio/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_timer/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_pm/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/mbedtls/port/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/mbedtls/mbedtls/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/mbedtls/mbedtls/library -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/mbedtls/esp_crt_bundle/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/mbedtls/mbedtls/3rdparty/everest/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/mbedtls/mbedtls/3rdparty/p256-m -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/mbedtls/mbedtls/3rdparty/p256-m/p256-m -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_app_format/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_bootloader_format/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/app_update/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/bootloader_support/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/bootloader_support/bootloader_flash/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_partition/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/efuse/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/efuse/esp32s3/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_mm/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/spi_flash/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/pthread/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_gptimer/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_ringbuf/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_uart/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/vfs/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/app_trace/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_event/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/nvs_flash/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_pcnt/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_spi/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_mcpwm/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_ana_cmpr/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_i2s/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/sdmmc/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_sdmmc/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_sdspi/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_sdio/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_dac/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_rmt/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_tsens/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_sdm/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_i2c/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_ledc/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_parlio/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_usb_serial_jtag/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/driver/deprecated -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/driver/i2c/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/driver/touch_sensor/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/driver/twai/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/driver/touch_sensor/esp32s3/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_phy/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_phy/esp32s3/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_vfs_console/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_netif/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/wpa_supplicant/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/wpa_supplicant/port/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/wpa_supplicant/esp_supplicant/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_coex/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_wifi/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_wifi/wifi_apps/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_wifi/wifi_apps/nan_app/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_wifi/include/local -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/unity/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/unity/unity/src -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/cmock/CMock/src -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/console -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/http_parser -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp-tls -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp-tls/esp-tls-crypto -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_adc/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_adc/interface -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_adc/esp32s3/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_adc/deprecated/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_isp/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_cam/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_cam/interface -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_jpeg/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_driver_ppa/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_eth/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_gdbstub/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_hid/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/tcp_transport/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_http_client/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_http_server/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_https_ota/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_https_server/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_psram/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_lcd/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_lcd/interface -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_lcd/rgb/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/protobuf-c/protobuf-c -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/protocomm/include/common -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/protocomm/include/security -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/protocomm/include/transports -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/protocomm/include/crypto/srp6a -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/protocomm/proto-c -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/esp_local_ctrl/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/espcoredump/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/espcoredump/include/port/xtensa -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/wear_levelling/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/fatfs/diskio -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/fatfs/src -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/fatfs/vfs -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/idf_test/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/idf_test/include/esp32s3 -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/ieee802154/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/json/cJSON -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/mqtt/esp-mqtt/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/nvs_sec_provider/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/perfmon/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/spiffs/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/touch_element/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/usb/include -IC:/Users/Hamza/.platformio/packages/framework-espidf/components/wifi_provisioning/include -Imanaged_components/espressif__network_provisioning/include -Imanaged_components/chmorgan__esp-libhelix-mp3/libhelix-mp3/pub -Imanaged_components/espressif__esp-modbus/freemodbus/common/include -Imanaged_components/espressif__libsodium/libsodium/src/libsodium/include -Imanaged_components/espressif__libsodium/port_include -Imanaged_components/espressif__mdns/include -Imanaged_components/espressif__esp-dsp/modules/dotprod/include -Imanaged_components/espressif__esp-dsp/modules/support/include -Imanaged_components/espressif__esp-dsp/modules/support/mem/include -Imanaged_components/espressif__esp-dsp/modules/windows/include -Imanaged_components/espressif__esp-dsp/modules/windows/hann/include -Imanaged_components/espressif__esp-dsp/modules/windows/blackman/include -Imanaged_components/espressif__esp-dsp/modules/windows/blackman_harris/include -Imanaged_components/espressif__esp-dsp/modules/windows/blackman_nuttall/include -Imanaged_components/espressif__esp-dsp/modules/windows/nuttall/include -Imanaged_components/espressif__esp-dsp/modules/windows/flat_top/include -Imanaged_components/espressif__esp-dsp/modules/iir/include -Imanaged_components/espressif__esp-dsp/modules/fir/include -Imanaged_components/espressif__esp-dsp/modules/math/include -Imanaged_components/espressif__esp-dsp/modules/math/add/include -Imanaged_components/espressif__esp-dsp/modules/math/sub/include -Imanaged_components/espressif__esp-dsp/modules/math/mul/include -Imanaged_components/espressif__esp-dsp/modules/math/addc/include -Imanaged_components/espressif__esp-dsp/modules/math/mulc/include -Imanaged_components/espressif__esp-dsp/modules/math/sqrt/include -Imanaged_components/espressif__esp-dsp/modules/matrix/mul/include -Imanaged_components/espressif__esp-dsp/modules/matrix/add/include -Imanaged_components/espressif__esp-dsp/modules/matrix/addc/include -Imanaged_components/espressif__esp-dsp/modules/matrix/mulc/include -Imanaged_components/espressif__esp-dsp/modules/matrix/sub/include -Imanaged_components/espressif__esp-dsp/modules/matrix/include -Imanaged_components/espressif__esp-dsp/modules/fft/include -Imanaged_components/espressif__esp-dsp/modules/dct/include -Imanaged_components/espressif__esp-dsp/modules/conv/include -Imanaged_components/espressif__esp-dsp/modules/common/include -Imanaged_components/espressif__esp-dsp/modules/matrix/mul/test/include -Imanaged_components/espressif__esp-dsp/modules/kalman/ekf/include -Imanaged_components/espressif__esp-dsp/modules/kalman/ekf_imu13states/include -Imanaged_components/espressif__esp-sr/src/include -Imanaged_components/espressif__esp-sr/esp-tts/esp_tts_chinese/include -Imanaged_components/espressif__esp-sr/include/esp32s3 -Imanaged_components/espressif__esp-zboss-lib/include -Imanaged_components/espressif__esp-zigbee-lib/include -Imanaged_components/espressif__rmaker_common/include -Imanaged_components/espressif__esp_diagnostics/include -Imanaged_components/espressif__cbor/port/include -Imanaged_components/espressif__esp_diag_data_store/src/rtc_store -Imanaged_components/espressif__esp_diag_data_store/include -Imanaged_components/espressif__esp_insights/include -Imanaged_components/espressif__esp_modem/include -Imanaged_components/espressif__jsmn/include -Imanaged_components/espressif__json_parser/include -Imanaged_components/espressif__json_generator/include -Imanaged_components/espressif__esp_schedule/include -Imanaged_components/espressif__esp-serial-flasher/include -Imanaged_components/espressif__esp-serial-flasher/port -Imanaged_components/espressif__esp_rcp_update/include -Imanaged_components/espressif__esp_secure_cert_mgr/include -Imanaged_components/espressif__esp_rainmaker/include -Imanaged_components/espressif__qrcode/include -Imanaged_components/joltwallet__littlefs/include -Imanaged_components/espressif__arduino-esp32/variants/esp32s3 -Imanaged_components/espressif__arduino-esp32/cores/esp32 -Imanaged_components/espressif__arduino-esp32/libraries/AsyncUDP/src -Imanaged_components/espressif__arduino-esp32/libraries/DNSServer/src -Imanaged_components/espressif__arduino-esp32/libraries/ESPmDNS/src -Imanaged_components/espressif__arduino-esp32/libraries/FS/src -Imanaged_components/espressif__arduino-esp32/libraries/LittleFS/src -Imanaged_components/espressif__arduino-esp32/libraries/Network/src -Imanaged_components/espressif__arduino-esp32/libraries/SPI/src -Imanaged_components/espressif__arduino-esp32/libraries/WiFi/src -Imanaged_components/espressif__arduino-esp32/libraries/Wire/src .pio/libdeps/esp32s3-devkitc/AEAD_OCB/test.c

This just needs to be

extra_scripts = pre:scripts/build_flags.py
2 Likes

Seems I missed it, but what deceived me is the debug print of the file which is printed way before the compilation process began.