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 ()