[cfe-commits] r66301 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.def lib/Sema/SemaDecl.cpp test/Sema/function-redecl.c test/Sema/knr-def-call.c

Douglas Gregor dgregor at apple.com
Sat Mar 7 07:18:28 PST 2009


On Mar 6, 2009, at 10:51 PM, Neil Booth <neil at daikokuya.co.uk> wrote:

> Neil Booth wrote:-
>
>> Douglas Gregor wrote:-
>>
>>> Author: dgregor
>>> Date: Fri Mar  6 16:43:54 2009
>>> New Revision: 66301
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=66301&view=rev
>>> Log:
>>> Implement GNU C semantics for K&R function definitions that follow a
>>> prototype of the same function, where the promoted parameter types  
>>> in
>>> the K&R definition are not compatible with the types in the
>>> prototype. Fixes PR2821.
>>
>> You seem to imply this is something that GCC is doing itself; I
>> don't believe that's true.  The only thing I recall being undesirable
>> about GCC's handling of K&R prototypes was that it didn't diagnose
>> *enough* undefined behaviour that was easily diagnosable.  I think
>> EDG diagnosed those extra cases.
>
> Apologies for the misunderstanding, it seems you were downgrading an
> error rather than upgrading a missed diagnostic.

Downgrading an error and giving it the same runtime behavior as GCC,  
which means using the calling convention of the prototype.

   - Doug




More information about the cfe-commits mailing list