Re: adding G_GNUC_MAY_ALIAS macro to gmacros.h



I am not against adding such a macro, but it sounds a whole lot
like you want to use it because "that part of the C standard does
not apply to me".

> 1) using unions (IMHO ugly)
That would work.

> 2) turning off strict aliasing (-fno-strict-aliasing)
How do you propose to do that for non-gcc users?

> 3) using extra variables which _might_ be optimized away
That would work.  (If the compiler does not handle the extra variable,
you can file a bug on it.  Regardless of whether it does, you will never
be able to tell without inspecting the code assembler output.)

> 4) using the may_alias gcc specific attribute keyword
What about other compilers?

See the trend?  The solutions that work are various forms of fixing the
source.

Morten
(Grumpy)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]