Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: gcc-patches@gcc.gnu.org
Cc: gdb-patches@sourceware.org
Subject: Add ATTRIBUTE_PACKED to ansidecl.h
Date: Wed, 06 Dec 2006 18:08:00 -0000	[thread overview]
Message-ID: <m38xhk3nk9.fsf@redhat.com> (raw)

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.

Cheers
  Nick

include/ChangeLog
2006-12-06  Nick Clifton  <nickc@redhat.com>

	* 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 */
 #endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
 
+/* Useful for structures whoes layout must much some binary specification
+   regardless of the alignment and padding qualities of the compiler.  */
+#ifndef ATTRIBUTE_PACKED
+# define ATTRIBUTE_PACKED __attribute__ ((packed))
+#endif
+
 /* We use __extension__ in some places to suppress -pedantic warnings
    about GCC extensions.  This feature didn't work properly before
    gcc 2.8.  */


             reply	other threads:[~2006-12-06 18:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-06 18:08 Nick Clifton [this message]
2006-12-06 18:47 ` Ian Lance Taylor
2006-12-06 23:40 ` Kaveh R. GHAZI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m38xhk3nk9.fsf@redhat.com \
    --to=nickc@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox