When the compiler flags are set as -Werror=pedantic
the code with FSP 5.5 does not compile. Both the -Werror and -pedantic must be turned off to not get the error or warning.
Can this be corrected or it's just me doing something different?
In file included from Y:/e2_studio/workspace_fsp55/ipsmcu_fsp55/ra/fsp/inc/api/fsp_common_api.h:17,
from Y:/e2_studio/workspace_fsp55/ipsmcu_fsp55/ra/fsp/inc/api/bsp_api.h:15,
from ../ra/fsp/src/bsp/mcu/all/bsp_common.c:11:
Y:/e2_studio/workspace_fsp55/ipsmcu_fsp55/ra/fsp/inc/fsp_version.h:43:38: error: array initialized from parenthesized string constant [-Werror=pedantic]
43 | #define FSP_VERSION_STRING ("5.5.0")
| ^
../ra/fsp/src/bsp/mcu/all/bsp_common.c:81:5: note: in expansion of macro 'FSP_VERSION_STRING'
81 | FSP_VERSION_STRING;
| ^~~~~~~~~~~~~~~~~~
Y:/e2_studio/workspace_fsp55/ipsmcu_fsp55/ra/fsp/inc/fsp_version.h:46:38: error: array initialized from parenthesized string constant [-Werror=pedantic]
46 | #define FSP_VERSION_BUILD_STRING ("Built with Renesas Advanced Flexible Software Package version 5.5.0")
../ra/fsp/src/bsp/mcu/all/bsp_common.c:85:5: note: in expansion of macro 'FSP_VERSION_BUILD_STRING'
85 | FSP_VERSION_BUILD_STRING;
| ^~~~~~~~~~~~~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors
make: *** [ra/fsp/src/bsp/mcu/all/subdir.mk:61: ra/fsp/src/bsp/mcu/all/bsp_common.o] Error 1
../ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/startup.c:119:5: error: ISO C forbids conversion of object pointer to function pointer type [-Werror=pedantic]
119 | (exc_ptr_t) (&g_main_stack[0] + BSP_CFG_STACK_MAIN_BYTES), /* Initial Stack Pointer */
make: *** [ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/subdir.mk:28: ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/startup.o] Error 1
make: *** Waiting for unfinished jobs....
"make -r -j8 all" terminated with exit code 2. Build might be incomplete.
Hello,
Thanks for reaching out Renesas Engineering Community.
The specific compiler flag -pedantic pops up all the warning that are related with parts of code that do not meet the ISO C standards and rules.
These do not necessary violate any syntax rule but it shows up the parts of the code that are no compliant with ISO C standards.
The -Werror=pedantic makes all these warnings to behave as errors. Ad thus you are getting compilation errors.
In case while compiling your code you would like to check these warnings you should add the flag -Wpedantic or -pedantic in order to pop you up all the warnings related to ISO C rules and standards.
If you want to suppress this warnings simply add -Wno-pedantic
Please refer also here: https://gcc.gnu.org/onlinedocs/gcc/gcc-command-options/options-to-request-or-suppress-warnings.html#cmdoption-Wpedantic
Best Regards,
IK
I wanted these flags turned on, this was to make sure that my code is ISO C standard compliant.
It sounds like turning off -pedantic flags is my only option. Would Renesas plan to bring the FSP code into compliance with the ISO C standard?