This was reported to the Debian bug-tracking system:
$ cat foo.c
_Pragma("foo"); int y;
#define FOO _Pragma("foo"); int x;
FOO
[EMAIL PROTECTED]:~$ cpp-3.2 foo.c
# 1 "foo.c"
# 1 ""
# 1 ""
# 1 "foo.c"
# 1 "foo.c"
#pragma foo
# 1 "foo.c"
; int y;
# 3 "foo.c"
#pragma ; int x;foo
>
> >The issue is a rather pedantic one. Should an error be generated
> >by the compiler indicating that 'return 0' can never be reached?
>
> Not an error because the code is in fact correct, but a warning about
> unreachable code would be nice.
>
> Regards,
> Bart
>
Originally this had appeared
Carlos O'Donell wrote:
int main()
{
int a = 0;
while (a == 0) {
a = 1;
}
while (1)
/* Do nothing */ ;
return 0;
}
The issue is a rather pedantic one. Should an error be generated
by the compiler indicating that 'return 0' can never be reached?
Not an error because the code is in fact c
> Eugene,
>
> This code is completely correct as far as I can see. The second while is
> interpreted as a new while loop, and the closing; is short for {} in
> this case. I've expanded the code into a more intuitive form here:
>
> int main()
> {
> int a = 0;
>
> while (a == 0) {
> a =
Eugene,
This code is completely correct as far as I can see. The second while is
interpreted as a new while loop, and the closing; is short for {} in
this case. I've expanded the code into a more intuitive form here:
int main()
{
int a = 0;
while (a == 0) {
a = 1;
}
while (1)
/*
5 matches
Mail list logo