[cfe-commits] PATCH: Add -Wreturn-type-c-linkage
David Blaikie
dblaikie at gmail.com
Mon Feb 13 20:09:19 PST 2012
In addition to this (since this seems like a reasonable thread
discussing this warning functionality), it seems LLVM code currently
violates this warning (& since it's on-by-default, that means building
LLVM with ToT clang and -Werror will break), Aaron - could you look
into this & see what the right fix is? (whether the warning needs to
be more nuanced, the code needs to be fixed, or some other solution)
llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:308:14:
warning: 'lle_X_atexit' has C-linkage specified, but returns
user-defined type
'llvm::GenericValue' which is incompatible with C [-Wreturn-type]
GenericValue lle_X_atexit(FunctionType *FT,
^
llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:318:14:
warning: 'lle_X_exit' has C-linkage specified, but returns
user-defined type
'llvm::GenericValue' which is incompatible with C [-Wreturn-type]
GenericValue lle_X_exit(FunctionType *FT,
^
llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:325:14:
warning: 'lle_X_abort' has C-linkage specified, but returns
user-defined type
'llvm::GenericValue' which is incompatible with C [-Wreturn-type]
GenericValue lle_X_abort(FunctionType *FT,
^
llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:335:14:
warning: 'lle_X_sprintf' has C-linkage specified, but returns
user-defined type
'llvm::GenericValue' which is incompatible with C [-Wreturn-type]
GenericValue lle_X_sprintf(FunctionType *FT,
^
llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:416:14:
warning: 'lle_X_printf' has C-linkage specified, but returns
user-defined type
'llvm::GenericValue' which is incompatible with C [-Wreturn-type]
GenericValue lle_X_printf(FunctionType *FT,
^
llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:428:14:
warning: 'lle_X_sscanf' has C-linkage specified, but returns
user-defined type
'llvm::GenericValue' which is incompatible with C [-Wreturn-type]
GenericValue lle_X_sscanf(FunctionType *FT,
^
llvm[3]: Compiling PPCFrameLowering.cpp for Debug+Asserts build
llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:443:14:
warning: 'lle_X_scanf' has C-linkage specified, but returns
user-defined type
'llvm::GenericValue' which is incompatible with C [-Wreturn-type]
GenericValue lle_X_scanf(FunctionType *FT,
^
llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp:459:14:
warning: 'lle_X_fprintf' has C-linkage specified, but returns
user-defined type
'llvm::GenericValue' which is incompatible with C [-Wreturn-type]
GenericValue lle_X_fprintf(FunctionType *FT,
^
- David
On Mon, Feb 13, 2012 at 2:09 PM, Matt Beaumont-Gay <matthewbg at google.com> wrote:
> Thanks, submitted as r150418 after discussion on IRC.
>
> On Mon, Feb 13, 2012 at 14:02, Aaron Ballman <aaron at aaronballman.com> wrote:
>> On Mon, Feb 13, 2012 at 3:55 PM, Matt Beaumont-Gay <matthewbg at google.com> wrote:
>>> The new "your 'extern "C" function is returning a non-POD type'"
>>> warning fires on a lot of code which we would like to continue
>>> building with -Werror=return-type. This patch gives the new warning
>>> its own flag so it can be selectively disabled.
>>
>> Patch LGTM, but before I commit, I'm wondering if there's any argument
>> against having it in its own group?
>>
>> ~Aaron
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list