From da32e46936cca9ad191d178f6894ca133ba69db2 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Tue, 14 Feb 2012 21:29:32 +0000 Subject: [PATCH] Fixing warning due to the new "UTD return type in extern 'C'". Patch by Matt Johnson git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150508 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index 40e12cc98f7..c5ed6d16b22 100644 --- a/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -297,10 +297,14 @@ GenericValue Interpreter::callExternalFunction(Function *F, // Functions "exported" to the running application... // -// Visual Studio warns about returning GenericValue in extern "C" linkage +// Visual Studio and Clang warn about returning GenericValue in extern "C" linkage #ifdef _MSC_VER #pragma warning(disable : 4190) #endif +#ifdef __clang__ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wreturn-type" +#endif extern "C" { // Don't add C++ manglings to llvm mangling :) @@ -471,7 +475,10 @@ GenericValue lle_X_fprintf(FunctionType *FT, } // End extern "C" -// Done with externals; turn the warning back on +// Done with externals; turn the warning back on for Clang and Visual Studio +#ifdef __clang__ + #pragma clang diagnostic pop +#endif #ifdef _MSC_VER #pragma warning(default: 4190) #endif -- 2.34.1