This is the mail archive of the
mailing list for the GCC project.
Add ATTRIBUTE_PACKED to ansidecl.h
- From: Nick Clifton <nickc at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 06 Dec 2006 18:07:50 +0000
- Subject: Add ATTRIBUTE_PACKED to ansidecl.h
I am applying the patch below to add a definition of
ATTRIBUTE_PACKED to ansidecl.h along the lines of the other
attributes defined in this file. This definition is now needed by
the binutils sources.
Does anyone know when the packed attribute was actually introduced
into gcc ? I have not put a version number check into the patch
because as far as I could tell it came in when support for
__attribute__ was added.
2006-12-06 Nick Clifton <email@example.com>
* ansidecl.h (ATTRIBUTE_PACKED): Define.
--- include/ansidecl.h (revision 119579)
+++ include/ansidecl.h (working copy)
@@ -361,6 +361,12 @@ So instead we use the macro below and te
# endif /* GNUC >= 3.0 */
#endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
+/* Useful for structures whoes layout must much some binary specification
+ regardless of the alignment and padding qualities of the compiler. */
+# define ATTRIBUTE_PACKED __attribute__ ((packed))
/* We use __extension__ in some places to suppress -pedantic warnings
about GCC extensions. This feature didn't work properly before
gcc 2.8. */