This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for Bug No-8081
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: "Sitikant Sahu, Noida" <sitikants at noida dot hcltech dot com>
- Cc: Gabriel Dos Reis <gdr at integrable-solutions dot net>, gcc at gcc dot gnu dot org
- Date: Tue, 09 Sep 2003 10:03:13 -0700
- Subject: Re: Patch for Bug No-8081
- References: <E04CF3F88ACBD5119EFE00508BBB21210BE6E442@exch-01.noida.hcltech.com>
"Sitikant Sahu, Noida" <sitikants@noida.hcltech.com> writes:
> Gabriel Dos Reis wrote,
>
>>| Gabriel Dos Reis wrote,
>>|
>>| | > int *p = &func().val[i];
>>| |
>>| | >Bleah ill-thought-out extensions...
>>| |
>>| | Here the C parser takes care of semantics and emits the error.
>>|
>>| >Why an error?
>>|
>>|
>>| while compiling the above statement in gcc 2.96, I get this.
>>| x.c:15: invalid use of non-lvalue array
>>|
>>| while compiling the above statement in gcc 3.3, I get this.
>>| x.c:15: error: invalid operands to binary +
>>|
>>| These are also the error messages where the return type is not
>>| variable size.
>>| Is it the desired behaviour?
>
>>In C90, that is undefined behaviour. In C99, it is defined behaviour
>>and we should NOT error. Therefore, I suggest that the error be
>>conditionalized on the selected standard.
>
> I,now understood the issue. But I think this is another bug issue related
> to the parser.
Yes, this is a separate bug. You are under no obligation to fix it
with this patch. In fact, we'd prefer that you didn't, because that
would make it harder to review the patch. Please file a separate bug
report so we don't forget about it, though.
zw