On Jan 12, 2008 11:45 PM, Neil Booth <[EMAIL PROTECTED]> wrote:
> Eli Friedman wrote:-
>
> > Here is another test:
> > void foo3 (void)
> > {
> >   void* x = 0;
> >   void* y = &*x;
> > }
>
> Correct behaviour there depends on dialect:
>
> [EMAIL PROTECTED]:~/src/c$ ~/src/cfe/cfe /tmp/bug.c --c90
> "/tmp/bug.c", line 4: error: expression must be an lvalue or a function
>   void* y = &*x;
>              ^
> "/tmp/bug.c", line 4: warning: variable "y" declared but not used
>   void* y = &*x;
>         ^
>
> 1 error found compiling "/tmp/bug.c".
> [EMAIL PROTECTED]:~/src/c$ ~/src/cfe/cfe /tmp/bug.c --c99
> "/tmp/bug.c", line 4: warning: variable "y" declared but not used
>   void* y = &*x;
>         ^

Right... it's actually a completely different case from the first two
functions because void expressions aren't lvalues.

Wow, the C standard is really confusing.

-Eli
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Reply via email to