: 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
> 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
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
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:
> >
> > 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
> 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
> 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
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;
>
> 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
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
> > 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
> 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
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 d
>Submitter-Id: net
>Originator:Andy Chittenden
>Organization: BlueArc UK Ltd
>Confidential: no
>Synopsis: comparing function pointer with int does not produce error
>Severity:
>Priority:
>Category: c++
>Class:
>Release: 3.0
14 matches
Mail list logo