Re: Compiler error or? Microsoft VC++ v6.0

From: Torstein Hansen (torsteinRemoveThis_at_hansen.as)
Date: 02/17/04


Date: Tue, 17 Feb 2004 21:19:22 GMT


"Ron Natalie" <ron@sensor.com> wrote in message
news:403282f0$0$139$9a6e19ea@news.newshosting.com...
>
> "Torstein Hansen" <torsteinRemoveThis@hansen.as> wrote in message
news:kpvYb.464$72.135468032@news.telia.no...
>
> > But in this code it's not the literal 0, rather
> > const unsigned long u0 = 0
> >
> That's good enough. The rule says that a null pointer constant is a
integer
> constant expression evaluating to zero. A const variable initialized
with a
> constant qualifies as a constant expression.
>

Right - I'll just have to accept the rule. Even though it made for some
long deep looks into the code to figure out what happened...

Thanks all...

Torstein



Relevant Pages

  • Re: segfault on strtok
    ... >>A constant expression with a value of zero, ... > I was looking at the standard when I wrote it. ... > integer which is zero is a null pointer constant if cast to void *. ...
    (comp.lang.c)
  • Re: segfault on strtok
    ... > integer which is zero is a null pointer constant if cast to void *. ... > a pointer type. ... An integer constant expression with the value 0, ...
    (comp.lang.c)
  • Re: Cant put Global Const AppOpenTime = Now in global module
    ... compile error says "Constant expression required" ... Nowis not a constant expression, now, is it? ... whatever form or switchboard opens when you open your app, ... just check for a zero value if in the variable. ...
    (comp.databases.ms-access)
  • Re: De-referencing NULL
    ... pointer performs the same action as deferencing a pointer containing ... address zero. ... due to the special-case rule that C uses to define ... constant expression or not, ...
    (comp.lang.c)
  • Re: Compiler error or? Microsoft VC++ v6.0
    ... The rule says that a null pointer constant is a ... >> constant expression evaluating to zero. ... >> constant qualifies as a constant expression. ... I'm Schobi at suespammers dot org ...
    (microsoft.public.vc.language)