This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: [RFC] ordered comparison of pointer with integer zero warning in Wextra
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: 'Manuel LÃpez-IbÃÃez' <lopezibanez at gmail dot com>
- Cc: "'gcc'" <gcc at gcc dot gnu dot org>
- Date: Wed, 20 Dec 2006 01:22:14 -0000
- Subject: RE: [RFC] ordered comparison of pointer with integer zero warning in Wextra
On 20 December 2006 00:39, Manuel LÃpez-IbÃÃez wrote:
> On 20/12/06, Dave Korn <dave.korn@artimi.com> wrote:
>> Heh. Or you could always make it a divide-by-zero error instead :)
>
> Oh, sorry. I didn't get this. If you would be so kind to elaborate...
Possibly the world's only attempt ever at C pointer-arithmetic humour, and now we know why. Ordered comparison of pointers amounts to pointer subtraction which is done in units of the size of the pointed-to type and the sizeof void is zero[*].
cheers,
DaveK
[*] - Or conceivably NaN.
--
Can't think of a witty .sigline today....