UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UnixPlatformCompilerPreSetup.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#ifndef PRAGMA_DISABLE_DEPRECATED_REGISTER_WARNINGS
6 #define PRAGMA_DISABLE_DEPRECATED_REGISTER_WARNINGS \
7 _Pragma("clang diagnostic push") \
8 _Pragma("clang diagnostic ignored \"-Wdeprecated-register\"")
9#endif // PRAGMA_DISABLE_DEPRECATED_REGISTER_WARNINGS
10
11#ifndef PRAGMA_ENABLE_DEPRECATED_REGISTER_WARNINGS
12 #define PRAGMA_ENABLE_DEPRECATED_REGISTER_WARNINGS \
13 _Pragma("clang diagnostic pop")
14#endif // PRAGMA_ENABLE_DEPRECATED_REGISTER_WARNINGS
15
16#ifndef PRAGMA_DISABLE_NULL_DEREFERENCE_WARNINGS
17 #if (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 9))
18 #define PRAGMA_DISABLE_NULL_DEREFERENCE_WARNINGS \
19 _Pragma ("clang diagnostic push") \
20 _Pragma ("clang diagnostic ignored \"-Wnull-dereference\"")
21 #else
22 #define PRAGMA_DISABLE_NULL_DEREFERENCE_WARNINGS \
23 _Pragma ("clang diagnostic push")
24 #endif // (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 9))
25#endif // PRAGMA_DISABLE_NULL_DEREFERENCE_WARNINGS
26
27#ifndef PRAGMA_ENABLE_NULL_DEREFERENCE_WARNINGS
28 #define PRAGMA_ENABLE_NULL_DEREFERENCE_WARNINGS \
29 _Pragma("clang diagnostic pop")
30#endif // PRAGMA_ENABLE_NULL_DEREFERENCE_WARNINGS
31
32// Disable platform-specific CA warnings around SDK includes in addition to common Clang warnings
33#ifndef THIRD_PARTY_INCLUDES_START
34 #define THIRD_PARTY_INCLUDES_START \
35 UE_COMPILER_THIRD_PARTY_INCLUDES_START \
36 PRAGMA_DISABLE_NULL_DEREFERENCE_WARNINGS \
37 PRAGMA_DISABLE_DEPRECATED_REGISTER_WARNINGS \
38 PRAGMA_DISABLE_MACRO_REDEFINED_WARNINGS
39#endif
40
41#ifndef THIRD_PARTY_INCLUDES_END
42 #define THIRD_PARTY_INCLUDES_END \
43 PRAGMA_ENABLE_MACRO_REDEFINED_WARNINGS \
44 PRAGMA_ENABLE_DEPRECATED_REGISTER_WARNINGS \
45 PRAGMA_ENABLE_NULL_DEREFERENCE_WARNINGS \
46 UE_COMPILER_THIRD_PARTY_INCLUDES_END
47#endif
48
49// Make certain warnings always be warnings, even despite -Werror.
50// Rationale: we don't want to suppress those as there are plans to address them (e.g. UE-12341), but breaking builds due to these warnings is very expensive
51// since they cannot be caught by all compilers that we support. They are deemed to be relatively safe to be ignored, at least until all SDKs/toolchains start supporting them.
52#pragma clang diagnostic warning "-Wparentheses-equality"
53