ARM Cortex-M0 GCC port and avoiding compiler warnings
Posted by
cmcqueen1975 on February 15, 2018
In FreeRTOS/Source/portable/GCC/ARM_CM0/port.c, there is a line:
~~~
if !defined (ARMCC_VERSION) && (ARMCC_VERSION >= 6010050)
~~~
But that doesn’t make sense — wouldn’t it always be false? I wonder if it should instead be:
~~~
if !(defined (ARMCC_VERSION) && (ARMCC_VERSION >= 6010050))
~~~
or maybe:
~~~
if !defined (ARMCC_VERSION) || (ARMCC_VERSION >= 6010050)
~~~
But I don’t know since I don’t have a thorough knowledge of the behaviour of the different types of compilers that were considered when this was added.
I am able to compile my code with a GCC ARM cross-compiler, versions 4.7.4 and 4.9.3. With the 4.7.4, I get a warning “control reaches end of non-void function [-Wreturn-type]”. But with 4.9.3, I don’t.
ARM Cortex-M0 GCC port and avoiding compiler warnings
Posted by
rtel on February 16, 2018
Some work was done in the last version to remove compiler warnings generated by newer versions of the compiler – although I agree this doesn’t look right so I will investigate.