[llvm-commits] [PATCH] Suppress "user-defined return type in extern C" warning under Clang
Matt Johnson
johnso87 at illinois.edu
Tue Feb 14 12:50:02 PST 2012
On 02/14/2012 02:42 PM, Aaron Ballman wrote:
> On Tue, Feb 14, 2012 at 2:28 PM, David Blaikie<dblaikie at gmail.com> wrote:
>> [+aaron who added this warning& was already looking into the fix for LLVM]
>>
>> Perhaps you've got the right fix - but at least Aaron won't keep
>> working on it redundantly. It looks reasonable to me.
> The patch looks like it will work the same for clang as it does for
> MSVC, which is good. But I'm a bit concerned as to why we have an
> extern "C" function that returns a type that can't be represented in
> C. Is that the problem we should be solving instead?
My understanding is that we're declaring these functions as 'extern "C"'
not to actually call them from C code, but just to avoid mangling. The
VS2010 docs (http://msdn.microsoft.com/en-us/library/1e02627y.aspx)
state that if the definition and all calls are *actually* C++ code,
doing this is legal. I'm far from an authority on the matter, but it
sounds reasonable.
-Matt
> ~Aaron
More information about the llvm-commits
mailing list