[En-Nut-Discussion] stm32_can.c fails to build

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Mon Aug 20 11:07:58 CEST 2012

>>>>> "Harald" == Harald Kipp <harald.kipp at egnite.de> writes:

    Harald> Hi Uwe, On 19.08.2012 15:30, Uwe Bonnes wrote:
    >> Okay, I compiled with -O0 for easier debugging, so the alias warning
    >> didn't appear. GCC knows about the
    >> __attribute__((__may_alias__)). Would appended patch be a sensible
    >> solution? It compiles to a single 32-bit access as opposed to the
    >> other proposed solutions. Is a solution like appended acceptable?

    Harald> I do not have any objections. But unless you supply a solution
    Harald> for other compilers, you need to add the requirement TOOL_GCC to
    Harald> nutarch_cm3_stm32f_can1 and nutarch_cm3_stm32f_can2 in
    Harald> stm32dev.nut.

For ARM, we have only compiler setups using GCC. And I also think that no
other compiler will be that picky about aliasing as GCC or the other
compiler will also have an  attribute like __may_alias__. 

Keeping everything in the definition and not spread it on header and
configuration files will help those who implement CM3 on other compilers.
Either when compiling the compiler barfs about  the aliasing, and the
implementers sees the __MAY_ALIAS attribute and looks for the attribute to
use on his compiler, or the compiler doesn't barf and everything is fine.

So I vote not to add the requierement TOOL_GCC for CM3.

Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

More information about the En-Nut-Discussion mailing list