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

Re: comparing function pointer with int does not produce error



> I don't think you're arguing the right side.  Look at my message - I
> don't know what the poster did, but _MY_ installed g++ v3.0 declares it
> invalid.  

And I assume everybody else's does so, as well: on my system, both g++
2.95 and 3.1 20011009 complain about your code (where the constant is
4), and accept the code of the poster (where the constant is 0).

So it has always been this way, for a reasonable definition of "always".

> I suppose that the argument you present above COULD apply, but
> considering 'static const int s = 0;' a NULL pointer constant seems
> very wrong to me somehow :)

Welcome to C++.

Regards,
Martin

P.S. I may still be misinterpreting the standard here, but I don't
think our "gut feeling" of how the language should be should guide the
analysis of this bug report. Instead, there is an accepted
international standard that everybody (compiler authors and users)
should follow.



Reply to: