qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@gnu.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Programmingkid <programmingkidx@gmail.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	"qemu-devel@nongnu.org qemu-devel" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] SLIRP warning messages displayed while compiling
Date: Sat, 12 Aug 2017 13:29:25 +0200	[thread overview]
Message-ID: <20170812112925.mpi2mmewt46wna7j@var.youpi.perso.aquilenet.fr> (raw)
In-Reply-To: <CAFEAcA-N5pAM+3PXvjaJ-LMPFswAtmkAXA6yn151CCtfn+=JQA@mail.gmail.com>

Peter Maydell, on sam. 12 août 2017 12:18:16 +0100, wrote:
> On 12 August 2017 at 12:04, Samuel Thibault <samuel.thibault@gnu.org> wrote:
> > Peter Maydell, on sam. 12 août 2017 11:53:20 +0100, wrote:
> >> The utility of the warning is that it means you get told
> >> about stuff that might break on other architectures.
> >
> > Sure, I understand that. But here all fields are aligned on their size
> > inside the packed structure. So there can't be alignment issues, and the
> > compiler should be able to determine that.
> 
> Alignment is architecture-dependent, and the compiler
> can't know the alignment requirements for every
> architecture.

Sure.

> There's no rule in C that says that uint16_t only needs 2 byte
> alignment and not 4 on some hosts.

Are there really systems where that happens?  Such systems would have to
pad uint16_t arrays then, really?

> (Also I just noticed 'struct ip6' uses bitfields:
> that's badly non-portable if it's trying to
> match an on-the-wire layout.)

struct ip has been doing so for so long too.

I'm not saying the code is perfectly portable, I'm just saying it's
portable enough for being both practical and readable.

Samuel

  reply	other threads:[~2017-08-12 11:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-10 20:44 [Qemu-devel] SLIRP warning messages displayed while compiling Programmingkid
2017-08-11 21:58 ` Samuel Thibault
2017-08-12 10:53   ` Peter Maydell
2017-08-12 11:04     ` Samuel Thibault
2017-08-12 11:18       ` Peter Maydell
2017-08-12 11:29         ` Samuel Thibault [this message]
2017-08-12 11:41           ` Eric Blake
2017-08-12 11:47             ` Samuel Thibault
2017-08-12 12:09               ` Eric Blake
2017-08-12 15:38             ` Philippe Mathieu-Daudé
2017-08-14 16:05               ` Eric Blake

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=20170812112925.mpi2mmewt46wna7j@var.youpi.perso.aquilenet.fr \
    --to=samuel.thibault@gnu.org \
    --cc=jan.kiszka@siemens.com \
    --cc=peter.maydell@linaro.org \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).