This is the mail archive of the 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]

Add ATTRIBUTE_PACKED to ansidecl.h

Hi Guys,

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

	* ansidecl.h (ATTRIBUTE_PACKED): Define.
Index: include/ansidecl.h
--- 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 */
+/* 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.  */

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