From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19786 invoked by alias); 9 Aug 2008 19:18:12 -0000 Received: (qmail 19776 invoked by uid 22791); 9 Aug 2008 19:18:11 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 09 Aug 2008 19:17:37 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id m79JG99g018059; Sat, 9 Aug 2008 21:16:09 +0200 (CEST) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id m79JG9TD003200; Sat, 9 Aug 2008 21:16:09 +0200 (CEST) Date: Sat, 09 Aug 2008 19:18:00 -0000 Message-Id: <200808091916.m79JG9TD003200@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: eliz@gnu.org CC: pedro@codesourcery.com, gdb-patches@sourceware.org In-reply-to: (message from Eli Zaretskii on Sat, 09 Aug 2008 21:54:20 +0300) Subject: Re: go32-nat, always a thread References: <200808080439.17254.pedro@codesourcery.com> <200808091853.44771.pedro@codesourcery.com> 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: 2008-08/txt/msg00255.txt.bz2 > Date: Sat, 09 Aug 2008 21:54:20 +0300 > From: Eli Zaretskii > > > From: Pedro Alves > > Date: Sat, 9 Aug 2008 18:53:44 +0100 > > > > GCC complains about attribute packed like so: > > > > cc1.exe: warnings being treated as errors > > ../../gdb/go32-nat.c:1292: warning: 'packed' attribute ignored for field of type 'unsigned char' > > ../../gdb/go32-nat.c:1301: warning: 'packed' attribute ignored for field of type 'unsigned char' > > This one is the only one that bother me a little, since these > structures need to match the memory layouts expected by the system > calls to which we pass them. Does the warning mean that GCC will > never add any padding between the previous field and the `unsigned > char' field? If so, the change is safe; if not, we need to find some > way of enforcing the no-padding layouts. Instead of struct foo { char c __attribute__((packed)); int d __attribute__((packed)); }; you can (should?) write struct foo { char c; int d; } __attribute__((packed)); I think that'll get rid of the warning.