analogdevicesinc / msdk

Software Development Kit for Analog Device's MAX-series microcontrollers
Apache License 2.0
61 stars 81 forks source link

Minor warnings at mxc_sys.h #948

Closed alperenguclu closed 6 months ago

alperenguclu commented 7 months ago

I am receiving following warnings in the mxc_sys.h file, and this issue seems to be present in most microcontrollers.

Jake-Carter commented 6 months ago

Which GCC version are you compiling with?

alperenguclu commented 6 months ago

arm-none-eabi-gcc.exe (GNU Arm Embedded Toolchain 10.3-2021.10) 10.3.1 20210824 (release)

Jake-Carter commented 6 months ago

Strange, -Wstrict-prototypes shouldn't be enabled by default... I don't see the warning on my machine or any of the build auto-testers, but if I manually enable it I see tons of warnings on other functions as well.

Does the flag show up explicitly in a verbose build for you? You can check with grep:

make distclean && make VERBOSE=1 | grep -- "-Wstrict-prototypes"

The fix is pretty trivial, we just need to add void to any functions with empty args. i.e.

-static inline void _mxc_crit_get_state()
+static inline void _mxc_crit_get_state(void)

Just curious how/why you're seeing the flag enabled.

alperenguclu commented 6 months ago

Yes, Jake, we are working on a Security project that will be integrated to Maxim SDK and we are using the -Wstrict-prototypes. I guess it will be nice to add void to functions with no args.