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]

Re: aliasing problem with va_arg


>>>>> 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


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