Manipulate with -Wreserved-identifier only if HAS_RESERVED_IDENTIFIER has been detected

This commit is contained in:
Denis Glazachev 2021-10-03 17:42:36 +04:00
parent 59fdfd18db
commit ca7b69b0f3
16 changed files with 19 additions and 14 deletions

View File

@ -176,6 +176,10 @@ if (COMPILER_CLANG)
endif()
endif ()
if (HAS_RESERVED_IDENTIFIER)
add_compile_definitions(HAS_RESERVED_IDENTIFIER)
endif()
# If turned `ON`, assumes the user has either the system GTest library or the bundled one.
option(ENABLE_TESTS "Provide unit_test_dbms target with Google.Test unit tests" ON)
option(ENABLE_EXAMPLES "Build all example programs in 'examples' subdirectories" OFF)

View File

@ -16,7 +16,7 @@ extern "C"
}
#endif
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,4 +1,4 @@
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,7 +1,7 @@
#pragma once
#include <cstddef>
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,4 +1,4 @@
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -27,7 +27,7 @@
#define _PATH_TTY "/dev/tty"
#endif
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,6 +1,7 @@
include (CheckCXXCompilerFlag)
include (CheckCCompilerFlag)
check_cxx_compiler_flag("-Wreserved-identifier" HAS_RESERVED_IDENTIFIER)
check_cxx_compiler_flag("-Wsuggest-destructor-override" HAS_SUGGEST_DESTRUCTOR_OVERRIDE)
check_cxx_compiler_flag("-Wshadow" HAS_SHADOW)
check_cxx_compiler_flag("-Wsuggest-override" HAS_SUGGEST_OVERRIDE)

View File

@ -31,7 +31,7 @@
M(int, pthread_mutex_unlock, pthread_mutex_t * arg)
#endif
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,4 +1,4 @@
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,4 +1,4 @@
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,4 +1,4 @@
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,4 +1,4 @@
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -11,7 +11,7 @@
#include <sys/stat.h>
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,4 +1,4 @@
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,4 +1,4 @@
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif

View File

@ -1,4 +1,4 @@
#if defined(__clang__) && __clang_major__ >= 13
#ifdef HAS_RESERVED_IDENTIFIER
#pragma clang diagnostic ignored "-Wreserved-identifier"
#endif