An alias bug

Toon Moene toon@moene.indiv.nluug.nl
Sun Jul 12 04:00:00 GMT 1998


   Date: Sat, 11 Jul 1998 23:43:07 -0600
   From: Jeffrey A Law <law@cygnus.com>

   "u" is a "long long", I don't think casting it to "long_long_type"
   is valid C or C++.

and David replied:

>  I see this come up now and again, so I'm finally going
>  to ask.  How do we tell users they can take one type,
>  and look at "pieces" of it, when they use gcc?  Or are
>  you saying that we declare "long long" as a special case
>  in this regard?
>
>  There is a lot of legacy code out there which does this.
>  One example is the "portable" generic IP networking
>  checksum function provided in the BSD networking sources.

Couldn't we just offer users that "have" to pull those non-standard  
tricks a compile-time flag that tells the compiler to allow these  
aliases ?

In the Fortran manual it's one of the "help, my code doesn't work  
with g77" examples:  If people write code which writes into  
overlapping arguments (or arguments that overlap with COMMON -  
global - storage), their code is broken, but they can get by (limp  
along) by using the compile time flage -fargument-alias.

HTH,
Toon.



More information about the Gcc-bugs mailing list