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: Compiling glibc-2.3.2 with gcc-3.4 yields "string2.h:80: warning: `packed' attribute ignored"


Jim Wilson wrote:
Dan Kegel wrote:

# define __STRING2_COPY_TYPE(N) \
typedef struct { unsigned char __arr[N]; } \
__STRING2_COPY_ARR##N __attribute__ ((packed))


This looks like a glibc problem. The syntax for typedef is roughly
typedef <type> <name>;
glibc put the attribute at the end, which means it is after <name>, but attaching a packed attribute to a name is useless, and hence it is being ignored. If you want the packed attribute to do something, it needs to be attached to <type> intead of <name>.

It looks like Ulrich reads this list. He checked in your proposed change 30 minutes ago:


http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/string/bits/string2.h.diff?r1=1.68&r2=1.69&cvsroot=glibc

Thanks!
- Dan

--
Dan Kegel
http://www.kegel.com
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045


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