This is the mail archive of the gcc@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: strict-aliasing and typedefs


> If I have the typedefs and variables
> 
> typedef int stackslot;
> typedef int heapslot;
> 
> stackslot *sp;
> heapslot *hp;
> 
> then can sp and hp point to the same location in memory with
> ISO C's aliasing rules?

Yes indeed. C is not Ada :-) There is only one int type, and giving it
different names does not make distinct types.


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