From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rbv6N-0006Oo-O5 for qemu-devel@nongnu.org; Sat, 17 Dec 2011 09:19:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rbv6M-0003sN-Mk for qemu-devel@nongnu.org; Sat, 17 Dec 2011 09:19:03 -0500 Message-ID: <4EECA4CF.5030407@redhat.com> Date: Sat, 17 Dec 2011 07:18:55 -0700 From: Eric Blake MIME-Version: 1.0 References: <1324110459-3932-1-git-send-email-sw@weilnetz.de> <1324110459-3932-4-git-send-email-sw@weilnetz.de> <4EEC86E9.7080404@weilnetz.de> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigAEF3AE2E0D946BFC54C06920" Subject: Re: [Qemu-devel] [PATCH 03/11] configure: Fix compiler warning in config.log (integer from pointer) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-trivial@nongnu.org, Stefan Weil , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAEF3AE2E0D946BFC54C06920 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/17/2011 07:09 AM, Peter Maydell wrote: >> Typically NULL is defined to be ((void *)0 for C >> (that's the reason why I used a type cast, too). Only for >> C++ it is defined without a type cast. >=20 > The C standard permits plain "0" as a definition of NULL. POSIX concurs with the C standard that a plain "0" can be used for representing a null pointer, but requires that the macro NULL be defined as ((void*)0) as a tighter requirement than C. http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#t= ag_03_244 http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html#ta= g_13_47 > We use plain 0 for a null pointer constant in various > existing tests in configure; this is simpler and avoids > dragging in stddef.h. I would prefer that. I agree that configure tests should be as small as possible while still being correct, and use of a 0 constant without a cast, rather than NULL, is appropriate in that context. --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigAEF3AE2E0D946BFC54C06920 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJO7KTQAAoJEKeha0olJ0Nq5RgH/2z37HTv9z0jtU1xebzItV1x K7XZtP5muBcEkNkoJCm/kTsOKetS0BBea6sobCFMkSaYcSmOc9qqTRR/dCfhZel+ RR/t6DIrkQ4yKjo7KaQ7Xzj7KaJKxJoAelIb1nJh6tshhiPpgV93la6hP2u3rGTy 3Hfnmly6CS1/fVoj0q7kd+WGp8qs+k4VO/jZhItlXdceQ81cSAb3H6BB44Mzr042 4CByfQO/0Uh0j5Y9DhhesvP3pGr65pQ1mUTTDkelnr8EoUwNFdsAgg2YUg7DEJ3a RHbibQyAfIDfQVGi6h8feSD2mxIBlrpSNxKh6i+K+r1UbA8msLF3Fssw1y5tTPQ= =mWde -----END PGP SIGNATURE----- --------------enigAEF3AE2E0D946BFC54C06920--