qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "M. Warner Losh" <imp@bsdimp.com>
To: qemu-devel@nongnu.org, weil@mail.berlios.de
Subject: Re: [Qemu-devel] [PATCH] Fix definition of NULL
Date: Fri, 06 Feb 2009 16:25:49 -0700 (MST)	[thread overview]
Message-ID: <20090206.162549.-896935060.imp@bsdimp.com> (raw)
In-Reply-To: <498CA9B6.5080302@mail.berlios.de>

In message: <498CA9B6.5080302@mail.berlios.de>
            Stefan Weil <weil@mail.berlios.de> writes:
: Hello,
: 
: the definition of NULL in dyngen-exec.h is correct for C++
: but wrong for C. It results in a compiler warning.
: 
: My patch fixes it. Because Qemu does not support C++,
: I just used the C definition and did not try to support
: C++, too.

Actually, it is correct for C as well.  "#define NULL 0" is a
perfectly acceptable definition[*].  Your definition is also correct,
since there are two valid NULL pointer definitions in 'C'.  Which one
you use will determine which class of errors you catch, but neither
one will catch all errors.

which compilers is it generating warnings on and what are the
warnings?

Warner

[*] C9x section 3.2.3 para 3 states:

       [#3] An integer constant expression with  the  value  0,  or
       such  an  expression  cast  to type void *, is called a null
       pointer constant.

with a footnote that says NULL is defined in stddef.h.

      reply	other threads:[~2009-02-06 23:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06 21:20 [Qemu-devel] [PATCH] Fix definition of NULL Stefan Weil
2009-02-06 23:25 ` M. Warner Losh [this message]

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=20090206.162549.-896935060.imp@bsdimp.com \
    --to=imp@bsdimp.com \
    --cc=qemu-devel@nongnu.org \
    --cc=weil@mail.berlios.de \
    /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).