[LLVMbugs] [Bug 2412] New: GCC warning is a clang error

Bill Wendling isanbard at gmail.com
Wed Jun 4 13:20:14 PDT 2008


On Wed, Jun 4, 2008 at 7:25 AM, Neil Booth <neil at daikokuya.co.uk> wrote:
> bugzilla-daemon at cs.uiuc.edu wrote:-
>
>> For this code:
>>
>> $ cat t.c
>> void bar() {
>>   char ng;
>>
>>   welcome(ng);
>> }
>>
>> void welcome(new_game)
>>      char new_game;
>> {
>>   foo(new_game);
>> }
>>
> This is undefined behaviour in C90 and a constraint violation in C99.
> It is a good thing that compilers other than GCC reject this kind of
> shoddy code.  It doesn't take much to fix the code, whatever it was
> actually intended to mean.
>
> I believe more modern compilers should strive to far higher goals than
> "accept anything invalid just because GCC does", except perhaps in a
> well-documented GCC compatibility mode.  Even GCC doesn't strive to
> achieve that w.r.t. prior versions; every release is stricter in
> various areas than the prior one even for C.
>
ICC also emits a warning instead of an error.

-bw



More information about the llvm-bugs mailing list