This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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....


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]