Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: eliz@gnu.org
Cc: pedro@codesourcery.com, gdb-patches@sourceware.org
Subject: Re: go32-nat, always a thread
Date: Sat, 09 Aug 2008 19:18:00 -0000	[thread overview]
Message-ID: <200808091916.m79JG9TD003200@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <ud4kihvdv.fsf@gnu.org> (message from Eli Zaretskii on Sat, 09 	Aug 2008 21:54:20 +0300)

> Date: Sat, 09 Aug 2008 21:54:20 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> 
> > From: Pedro Alves <pedro@codesourcery.com>
> > 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.


  reply	other threads:[~2008-08-09 19:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08  3:39 Pedro Alves
2008-08-08  3:41 ` Pedro Alves
2008-08-08  8:01 ` Eli Zaretskii
2008-08-08 12:43   ` Daniel Jacobowitz
2008-08-08 12:47     ` Eli Zaretskii
2008-08-08 12:55       ` Daniel Jacobowitz
2008-08-09 17:54   ` Pedro Alves
2008-08-09 18:06     ` Tom Tromey
2008-08-09 18:15       ` Pedro Alves
2008-08-09 18:22       ` Daniel Jacobowitz
2008-08-09 18:55     ` Eli Zaretskii
2008-08-09 19:18       ` Mark Kettenis [this message]
2008-08-09 19:31         ` Daniel Jacobowitz
2008-08-09 21:32           ` Eli Zaretskii
2008-08-09 21:33       ` Pedro Alves

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=200808091916.m79JG9TD003200@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /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