From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7980 invoked by alias); 6 Dec 2006 18:08:15 -0000 Received: (qmail 7961 invoked by uid 22791); 6 Dec 2006 18:08:14 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Dec 2006 18:08:04 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kB6I7qu0031856; Wed, 6 Dec 2006 13:07:52 -0500 Received: from pobox.surrey.redhat.com (pobox.surrey.redhat.com [172.16.10.17]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id kB6I7pMx019411; Wed, 6 Dec 2006 13:07:51 -0500 Received: from localhost.localdomain.redhat.com (vpn-68-6.surrey.redhat.com [10.32.68.6]) by pobox.surrey.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id kB6I7o6d023801; Wed, 6 Dec 2006 18:07:50 GMT To: gcc-patches@gcc.gnu.org Cc: gdb-patches@sourceware.org Subject: Add ATTRIBUTE_PACKED to ansidecl.h From: Nick Clifton Date: Wed, 06 Dec 2006 18:08:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00069.txt.bz2 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 * 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. */