RE: comparing function pointer with int does not produce error

2001-10-24 Thread Martin Dorey
: comparing function pointer with int does not produce error > I can't disagree with your reading ("involve" doesn't mean "be"). However, > searching for "integral constant expression" suggests to me that this > outlaws the following code, all of w

Re: comparing function pointer with int does not produce error

2001-10-24 Thread Martin v. Loewis
> I can't disagree with your reading ("involve" doesn't mean "be"). However, > searching for "integral constant expression" suggests to me that this > outlaws the following code, all of which compiles without warning: > > enum {dim = 1}; > char a [dim]; // 8.3.4.1 Please note that only null poin

Re: comparing function pointer with int does not produce error

2001-10-24 Thread Daniel Jacobowitz
On Wed, Oct 24, 2001 at 09:15:00AM +0200, Martin v. Loewis wrote: > > 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, bo

RE: comparing function pointer with int does not produce error

2001-10-24 Thread Martin Dorey
ED]; debian-gcc@lists.debian.org; [EMAIL PROTECTED] Subject: Re: comparing function pointer with int does not produce error > > I'll take another attempt at declaring gcc behaviour to be correct. > > According to 4.10/1, "success" is a null pointer constant: > >

Re: comparing function pointer with int does not produce error

2001-10-24 Thread Martin v. Loewis
> > I'll take another attempt at declaring gcc behaviour to be correct. > > According to 4.10/1, "success" is a null pointer constant: > > > > # A null pointer constant is an integral constant expression (5.19) > > # rvalue of integer type that evaluates to zero. A null pointer > > # constant can

RE: comparing function pointer with int does not produce error

2001-10-24 Thread Andy Chittenden
> I'll take another attempt at declaring gcc behaviour to be correct. > According to 4.10/1, "success" is a null pointer constant: > > # A null pointer constant is an integral constant expression (5.19) > # rvalue of integer type that evaluates to zero. A null pointer > # constant can be converted

Re: comparing function pointer with int does not produce error

2001-10-24 Thread Martin v. Loewis
> 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

Re: comparing function pointer with int does not produce error

2001-10-24 Thread Daniel Jacobowitz
On Tue, Oct 23, 2001 at 11:51:46PM +0200, Martin v. Loewis wrote: > > On Tue, Oct 23, 2001 at 08:21:26PM +0200, Martin v. Loewis wrote: > > > > The following code does not produce an error when one is > > > > expected. > > > > void stat (); > > > > > > > > static const int success = 0; >

Re: comparing function pointer with int does not produce error

2001-10-23 Thread Martin v. Loewis
> On Tue, Oct 23, 2001 at 08:21:26PM +0200, Martin v. Loewis wrote: > > > The following code does not produce an error when one is expected. > > > void stat (); > > > > > > static const int success = 0; > > > > > > void monk () > > > { > > > if (stat == success); > > > }; > > > > Thanks for

Re: comparing function pointer with int does not produce error

2001-10-23 Thread Daniel Jacobowitz
On Tue, Oct 23, 2001 at 08:21:26PM +0200, Martin v. Loewis wrote: > > The following code does not produce an error when one is expected. > > void stat (); > > > > static const int success = 0; > > > > void monk () > > { > > if (stat == success); > > }; > > Thanks for your report. This is n

Re: comparing function pointer with int does not produce error

2001-10-23 Thread Martin v. Loewis
> > void stat (); > > > > static const int success = 0; > > > > void monk () > > { > > if (stat == success); > > }; > > > > warning: comparison between pointer and integer > > is produced here with same compiler, Debian (Sid) updated daily. Are you sure? Could it be that you are using a C c

Re: comparing function pointer with int does not produce error

2001-10-23 Thread Martin v. Loewis
> The following code does not produce an error when one is expected. > void stat (); > > static const int success = 0; > > void monk () > { > if (stat == success); > }; Thanks for your report. This is not a bug in the compiler: both the function pointer and the integer convert to bool (4

Re: comparing function pointer with int does not produce error

2001-10-23 Thread Gordon Sadler
On Tue, Oct 23, 2001 at 04:26:16PM +0100, [EMAIL PROTECTED] wrote: > > >Submitter-Id:net > >Originator: Andy Chittenden > >Organization:BlueArc UK Ltd > >Confidential:no > >Synopsis:comparing function pointer with int does not produce error > >Severity: > >Priority