This is the mail archive of the gcc-patches@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: Patch for PR other/13906 (md5.c does unaligned memory accesses)


> > + #  define ATTRIBUTE_ALIGNED_ALIGNOF(m)
> > + # endif /* GNUC >= 3.3 */
> 
> The above comment is wrong.

OK, that is easy to fix.

> > --- 80,86 ----
> >   
> >     md5_uint32 total[2];
> >     md5_uint32 buflen;
> > !   char buffer[128] ATTRIBUTE_ALIGNED_ALIGNOF(md5_uint32);
> >   };
> 
> How can buffer ever *not* be as aligned as an md5_uint32, when it
> follows one in the structure?

Well, if the alignment of the md5_uint32 type was greater than the size
of the md5_uint32 type, then buffer wouldn't necessarily have to have
the same alignment.  I doubt there are any real platforms with this
situation.

Steve Ellcey
sje@cup.hp.com


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