Coding - Suppress macOS system header warnings in multiple files (#997)

- Added clang diagnostic pragmas to suppress three specific warning types around macOS/iOS framework imports
- Added version-specific warning suppression for clang 20+ in the general warnings disable header
- Extended function cast warning suppression to cover clang's `-Wcast-function-type-mismatch`
This commit is contained in:
Pasukhin Dmitry
2026-01-14 21:22:11 +00:00
committed by GitHub
parent 0a1e8b7802
commit b5cd7a8410
8 changed files with 44 additions and 2 deletions

View File

@@ -24,11 +24,17 @@
#import <TargetConditionals.h>
// Suppress warnings from macOS system headers
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wmissing-method-return-type"
#pragma clang diagnostic ignored "-Wavailability"
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#pragma clang diagnostic pop
#include <OpenGl_GlCore11.hxx>
#include <OpenGl_Context.hxx>

View File

@@ -24,17 +24,24 @@
#import <TargetConditionals.h>
// Suppress warnings from macOS system headers
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wmissing-method-return-type"
#pragma clang diagnostic ignored "-Wavailability"
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#pragma clang diagnostic pop
#if !defined(TARGET_OS_IPHONE) || !TARGET_OS_IPHONE
#if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7)
@interface NSView (LionAPI)
- (NSSize )convertSizeToBacking: (NSSize )theSize;
@end
#endif
#endif
#include <OpenGl_Window.hxx>

View File

@@ -17,11 +17,17 @@
#import <TargetConditionals.h>
// Suppress warnings from macOS system headers
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wmissing-method-return-type"
#pragma clang diagnostic ignored "-Wavailability"
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#pragma clang diagnostic pop
#ifndef HAVE_OBJC_ARC

View File

@@ -15,11 +15,17 @@
#import <TargetConditionals.h>
// Suppress warnings from macOS system headers
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic ignored "-Wmissing-method-return-type"
#pragma clang diagnostic ignored "-Wavailability"
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
#endif
#pragma clang diagnostic pop
#include <Cocoa_Window.hxx>