libcopp 2.3.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
stl_include_prefix.h
Go to the documentation of this file.
1// Copyright 2023 atframwork.
2// Created by owent on 2022-05-23
3// Usage:
4// // clang-format off
5// #include <libcopp/utils/config/stl_include_prefix.h> // NOLINT(build/include_order)
6// // clang-format on
7// #include <sstream> //...
8// // clang-format off
9// #include <libcopp/utils/config/stl_include_suffix.h> // NOLINT(build/include_order)
10// // clang-format on
11
12// This file may be include multiple times, do not add #pragma once here
13// NOLINT(build/header_guard)
14
15#ifndef LIBCOPP_UTILS_CONFIG_STL_INCLUDE_PREFIX_H
16#define LIBCOPP_UTILS_CONFIG_STL_INCLUDE_PREFIX_H
17
18// ============= Patch for some Compilers's mistake =============
19#if defined(_MSC_VER)
20# pragma warning(push)
21# pragma warning(disable : 4702)
22#elif defined(__GNUC__) && !defined(__clang__) && !defined(__apple_build_version__)
23# if (__GNUC__ * 100 + __GNUC_MINOR__ * 10) >= 460
24# pragma GCC diagnostic push
25# endif
26
27# pragma GCC diagnostic ignored "-Warray-bounds"
28# if (__GNUC__ * 100 + __GNUC_MINOR__ * 10) >= 710
29# pragma GCC diagnostic ignored "-Wstringop-overflow"
30# endif
31
32# if (__GNUC__ * 100 + __GNUC_MINOR__) == 1402
33# pragma GCC diagnostic ignored "-Wuninitialized"
34# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
35# endif
36
37# if defined(__SANITIZE_THREAD__)
38# pragma GCC diagnostic ignored "-Wtsan"
39# elif defined(__has_feature)
40# if __has_feature(thread_sanitizer)
41# pragma GCC diagnostic ignored "-Wtsan"
42# endif
43# endif
44#elif defined(__clang__) || defined(__apple_build_version__)
45# pragma clang diagnostic push
46# pragma GCC diagnostic ignored "-Warray-bounds"
47#endif
48
49#endif