From 736cb90ac6b90967f335f5a991a91ac38bba5e55 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 4 Feb 2019 15:20:44 +0100 Subject: [PATCH] [mtouch/mmp] Avoid a few clang warnings in the generated pinvoke code. (#5541) --- tools/common/PInvokeWrapperGenerator.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/common/PInvokeWrapperGenerator.cs b/tools/common/PInvokeWrapperGenerator.cs index 424cb17587..c74e6a192a 100644 --- a/tools/common/PInvokeWrapperGenerator.cs +++ b/tools/common/PInvokeWrapperGenerator.cs @@ -52,6 +52,13 @@ namespace Xamarin.Bundler mthds.WriteLine ($"#include \"{Path.GetFileName (HeaderPath)}\""); sb.WriteLine ("extern \"C\" {"); + + // Disable "control reaches end of non-void function" + // we throw exceptions in many code paths, which clang doesn't know about, triggering this warning. + sb.WriteLine ("#pragma clang diagnostic ignored \"-Wreturn-type\""); + + // Disable "warning: 'X' is only available on xOS Y.Z or newer" + sb.WriteLine ("#pragma clang diagnostic ignored \"-Wunguarded-availability-new\""); } public void End ()