This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: aliasing problem with va_arg
- To: wilson at cygnus dot com (Jim Wilson), egcs at cygnus dot com, Mark Mitchell <mark at markmitchell dot com>
- Subject: Re: aliasing problem with va_arg
- From: Jason Merrill <jason at cygnus dot com>
- Date: 28 Oct 1998 01:28:00 -0800
- References: <199810270257.SAA27424@smtp.earthlink.net> <199810271907.LAA04580.cygnus.egcs@rtl.cygnus.com>
>>>>> Jim Wilson <wilson@cygnus.com> writes:
> If there was a syntax for declaring a pointer to unaligned data, we could
> perhaps solve the problem by using that in the va_arg macro.
Here's what I did in frame.c:
union unaligned {
void *p;
unsigned b2 __attribute__ ((mode (HI)));
unsigned b4 __attribute__ ((mode (SI)));
unsigned b8 __attribute__ ((mode (DI)));
} __attribute__ ((packed));
static inline void *
read_pointer (void *p)
{ union unaligned *up = p; return up->p; }
..etc..
Jason