This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to use __attribute__((__may_alias__))


John Fine <johnsfine@verizon.net> writes:

> I tried
> DAT __attribute__((__may_alias__))* pp=foo();
> and
> DAT* __attribute__((__may_alias__)) pp=foo();
> but neither of those make any difference.

The may_alias attribute is normally applied to a type, not a variable.
It is possible that the attribute got dropped somewhere during
optimization.  That would be a bug, but I expect that this case is not
well tested.

I know you said that you didn't want to use a union, but that is what I
would recommend.  Using a union need not have any performance impact.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]