[SOLVED] Compiler warning generation using -Wall, -Wextra does not appear during building of project even though it's part of Environment options

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Compiler warning generation using -Wall, -Wextra does not appear during building of project even though it's part of Environment options

    I really would like my build to generate as many warnings as possible, when it makes sense. I'm using SES 3.34a

    In SES IDE, Tools > Options:
    The Compatibility section of the Build Environment Options shows the following:
    -Wall;-Wextra;-Wstrict-prototypes

    I can't seem to find any such thing in Project Options.

    However when the build is executed from the IDE, I do not see -Wall -Wextra etc, as can be seen below (I have eliminated the include paths from the build ouptut below):
    "C:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 3.34a/gcc/arm-none-eabi/bin/cc1" -fmessage-length=0 -fno-diagnostics-show-caret -mcpu=cortex-m4 -mlittle-endian -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mtp=soft -nostdinc "-isystemC:/Program Files/SEGGER/SEGGER Embedded Studio for ARM 3.34a/include" "-isystemC:/Users/kkw/AppData/Local/SEGGER/SEGGER Embedded Studio/v3/packages/include" -D__SIZEOF_WCHAR_T=4 -D__ARM_ARCH_7EM__ -D__SES_ARM -D__ARM_ARCH_FPV4_SP_D16__ -DNDEBUG -DBL_SETTINGS_ACCESS_ONLY -DBOARD_PCA10056 -DCONFIG_GPIO_AS_PINRESET -DFLOAT_ABI_HARD -DINITIALIZE_USER_SECTIONS -DNO_VTOR_CONFIG -DNRF52840_XXAA -DNRF_DFU_SVCI_ENABLED -DNRF_DFU_TRANSPORT_BLE=1 -DNRF_SD_BLE_API_VERSION=6 -DS140 -DSOFTDEVICE_PRESENT -DSWI_DISABLE0 -DUSE_APP_CONFIG -DDEBUG -MD "C:/git/an-3/nRF5_SDK_15.0.0_a53641a/project/ble/efgh/pca10056/s140/ses/Output/abcd Release/Obj/xyz.d" -MQ "Output/abcd Release/Obj/xyz.o" -quiet -g3 -gpubnames -std=gnu99 -fomit-frame-pointer -fno-dwarf2-cfi-asm -fno-builtin -ffunction-sections -fdata-sections -fshort-enums -fno-common C:\git\an-3\nRF5_SDK_15.0.0_a53641a\project\ble\efgh\qrst\xyz.c -o "C:/git/an-3/nRF5_SDK_15.0.0_a53641a/project/ble/efgh/pca10056/s140/ses/Output/abcd Release/Obj/xyz.asm"

    I tried using emBuild with the same result.

    How do I get the compiler to enforce this setting, of -Wall;-Wextra?

    Thanks & regards
    Kannan
  • Hello Kennan,

    Thank you for your inquiry.
    To enable all warnings you need to set the project option "Enable all warnings" to yes.
    Alternatively you can use the option "Additional C/C++ compiler options" to set additional build parameters.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Nino,

    As always, thanks. This solved my problem.

    Here's the interesting thing: After enabling -Wall,-Wextra;-Wstrict-prototypes, the compiler warned me that in a switch statement, I had misspelled "default" to "defaut" (the letter l is missing). Without adding these warnings, the compiler silently accepted it as a standard C label. :(

    Now that I now know where the options are, it's fine. Some suggestions:
    • Between Tools > Option > Build > Compatibility and the actual Project Options, it is confusing.
    • The Enable All Warnings is in Code Generation. I think it should have been in Project Option > Compiler OR Project Options > Build, since Enforce ANSI C checking is in Project Options > Compiler.
    I do appreciate your quick response. This matter is closed.

    Regards,
    Kannan
  • Hi Kannan,

    Great to hear that you are up and running again and thank you for your feedback.
    I will forward your feedback and we will discuss internally if it could be implemented.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.