[Top][All Lists]

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

Re: [Qemu-devel] Patch: dyngen-exec.h for OpenBSD

From: Anthony Liguori
Subject: Re: [Qemu-devel] Patch: dyngen-exec.h for OpenBSD
Date: Fri, 06 Apr 2007 22:34:33 -0500
User-agent: Thunderbird (X11/20070403)

Paul Brook wrote:
On Thursday 05 April 2007 23:12, Todd T. Fries wrote:
Penned by Thiemo Seufer on 20070402 10:54.53, we have:
| >  /* NOTE: standard headers should be used with special care at this
| >     point because host CPU registers are used as global variables. Some
| >     host headers do not allow that. */
| >  #include <stddef.h>
| > -
| > +#ifdef __OpenBSD__
| > +#include <sys/types.h>
Hello? Portability?  sys/types.h defines these types portably.
Doing so the way this code does it, is not portable.

If you want portability you should be including stdint.h (or inttypes.h for old, broken systems).

I thought I'd add that this isn't just portability. stdint.h is what C99 mandates although as Paul mentions, some older systems used inttypes.h.


Anthony Liguori

Why is it that qemu knows what the definition of these prototypes
are on all systems without consulting the header files.  I have a
better idea, lets let the header files define the prototypes.
Who would have though of that?

See the big NOTE: comment above. dyngen is inherently unportable.


reply via email to

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