qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] osdep: Remove local definition of macro offseto


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] osdep: Remove local definition of macro offsetof
Date: Mon, 05 Mar 2012 18:29:50 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20120207 Iceowl/1.0b1 Icedove/3.0.11

Am 05.03.2012 14:49, schrieb Peter Maydell:
On 5 March 2012 13:23, Andreas Färber <address@hidden> wrote:
Am 05.03.2012 07:22, schrieb Stefan Weil:
The macro offsetof is defined in stddef.h. It is conforming to
the standards C89, C99 and POSIX.1-2001 (see man page), so it
is a sufficiently old standard.

Therefore chances are very high that QEMU never needs a local
definition of this macro.

Did you check when this was introduced and whether the commit message
gave any explanation why?

It's been copied and moved around and rerationalised down to one
definition since then, but the first offsetof() definition was
added by Fabrice in fd6ce8f66 in May 2003, with no particular
comment about it. That is about as close as qemu gets to "it has
always been this way" :-)

Nearly a decade on, I think dropping it is probably reasonably
safe.

-- PMM

Thanks for your mail.

If anybody likes historic discussion threads, here is one from 2008:

http://lists.nongnu.org/archive/html/qemu-devel/2008-06/msg00009.html

I am working without the local definition in my QEMU tree since 4 years now.

Cheers,
Stefan W.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]