Compiler Warnings with "-Wpedantic"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compiler Warnings with "-Wpedantic"

1,350 Views
Masmiseim
Senior Contributor I

Hello NXP team,

 

could you test the target code for Freemaster (the one running on the microcontroller) with higher warning levels and make it warning-free? May I recommend the following warning flags:

-Wall

-Wextra

-Wpedantic

 

The code raises several Compiler-Warnings with the warning-settings from above. The following three warnings, lead to linker errors when LTO is activated:

Masmiseim_0-1725635176108.png

The following linker Errors with LTO active are created when the warnings are not solved:

Masmiseim_1-1725635176109.png

Yes, at first glance these seem to have nothing to do with the warnings. It took me a while to understand the problem.

GCC13 was used on iMXRT1170.

 

Thanks and best regards

4 Replies

752 Views
scotty
Contributor IV

Hello @MichalH,
please can you have a look on this request. Thank you.

0 Kudos
Reply

737 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello Michael,

we did address most of the -Wpedantic issues in the latest version of the FreeMASTER driver. You can check the code here: https://github.com/nxp-mcuxpresso/mcux-freemaster 

We'll continue the effort in next versions.

Regards,
Michal

732 Views
scotty
Contributor IV
Michal, thanks for your prompt response. I think we do not use the latest driver code from this repository right now. We will check this out.
Have a good day
michaeL
0 Kudos
Reply

1,261 Views
Prof_Farnsworth
Contributor I

I agree

To add to this, I also suggest to remove warnings generated with -Wundef (which seems not to be included in -Wall?)as the Freemaster header files checks a lot of potentially undefined precompiler constants.

0 Kudos
Reply