Skip to content

Commit afb3699

Browse files
committed
Disable Intellisense-only warnings in simdjson.h/cpp
1 parent d7f133c commit afb3699

File tree

5 files changed

+22
-14
lines changed

5 files changed

+22
-14
lines changed

include/simdjson.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
#include "simdjson/common_defs.h"
1212

1313
SIMDJSON_PUSH_DISABLE_WARNINGS
14-
#if defined(_MSC_VER) && defined(__clang__)
15-
SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include)
16-
#endif
14+
SIMDJSON_DISABLE_UNDESIRED_WARNINGS
1715

1816
// Public API
1917
#include "simdjson/simdjson_version.h"

include/simdjson/common_defs.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,12 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024;
7777
#define unlikely(x) x
7878
#endif
7979

80+
#include <CppCoreCheck\Warnings.h>
8081
#define SIMDJSON_PUSH_DISABLE_WARNINGS __pragma(warning( push ))
8182
#define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS __pragma(warning( push, 0 ))
8283
#define SIMDJSON_DISABLE_VS_WARNING(WARNING_NUMBER) __pragma(warning( disable : WARNING_NUMBER ))
84+
// Get rid of Intellisense-only warnings (Code Analysis)
85+
#define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_VS_WARNING(ALL_CPPCORECHECK_WARNINGS)
8386
#define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_VS_WARNING(4996)
8487
#define SIMDJSON_POP_DISABLE_WARNINGS __pragma(warning( pop ))
8588

@@ -113,6 +116,11 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024;
113116
SIMDJSON_DISABLE_GCC_WARNING(-Wunused-variable)
114117
#define SIMDJSON_PRAGMA(P) _Pragma(#P)
115118
#define SIMDJSON_DISABLE_GCC_WARNING(WARNING) SIMDJSON_PRAGMA(GCC diagnostic ignored #WARNING)
119+
#if defined(SIMDJSON_CLANG_VISUAL_STUDIO)
120+
#define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include)
121+
#else
122+
#define SIMDJSON_DISABLE_UNDESIRED_WARNINGS
123+
#endif
116124
#define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_GCC_WARNING(-Wdeprecated-declarations)
117125
#define SIMDJSON_POP_DISABLE_WARNINGS _Pragma("GCC diagnostic pop")
118126

singleheader/simdjson.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
/* auto-generated on Sat May 2 15:01:27 PDT 2020. Do not edit! */
1+
/* auto-generated on Mon May 4 11:46:14 PDT 2020. Do not edit! */
22
/* begin file src/simdjson.cpp */
33
#include "simdjson.h"
44

55
SIMDJSON_PUSH_DISABLE_WARNINGS
6-
#if defined(SIMDJSON_CLANG_VISUAL_STUDIO)
7-
SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include)
8-
#endif
6+
SIMDJSON_DISABLE_UNDESIRED_WARNINGS
97

108
/* begin file src/error.cpp */
119

singleheader/simdjson.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Sat May 2 15:01:27 PDT 2020. Do not edit! */
1+
/* auto-generated on Mon May 4 11:46:14 PDT 2020. Do not edit! */
22
/* begin file include/simdjson.h */
33
#ifndef SIMDJSON_H
44
#define SIMDJSON_H
@@ -328,9 +328,12 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024;
328328
#define unlikely(x) x
329329
#endif
330330
331+
#include <CppCoreCheck\Warnings.h>
331332
#define SIMDJSON_PUSH_DISABLE_WARNINGS __pragma(warning( push ))
332333
#define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS __pragma(warning( push, 0 ))
333334
#define SIMDJSON_DISABLE_VS_WARNING(WARNING_NUMBER) __pragma(warning( disable : WARNING_NUMBER ))
335+
// Get rid of Intellisense-only warnings (Code Analysis)
336+
#define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_VS_WARNING(ALL_CPPCORECHECK_WARNINGS)
334337
#define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_VS_WARNING(4996)
335338
#define SIMDJSON_POP_DISABLE_WARNINGS __pragma(warning( pop ))
336339
@@ -364,6 +367,11 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024;
364367
SIMDJSON_DISABLE_GCC_WARNING(-Wunused-variable)
365368
#define SIMDJSON_PRAGMA(P) _Pragma(#P)
366369
#define SIMDJSON_DISABLE_GCC_WARNING(WARNING) SIMDJSON_PRAGMA(GCC diagnostic ignored #WARNING)
370+
#if defined(SIMDJSON_CLANG_VISUAL_STUDIO)
371+
#define SIMDJSON_DISABLE_UNDESIRED_WARNINGS SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include)
372+
#else
373+
#define SIMDJSON_DISABLE_UNDESIRED_WARNINGS
374+
#endif
367375
#define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_GCC_WARNING(-Wdeprecated-declarations)
368376
#define SIMDJSON_POP_DISABLE_WARNINGS _Pragma("GCC diagnostic pop")
369377
@@ -1971,9 +1979,7 @@ namespace std {
19711979
/* end file include/simdjson/nonstd/string_view.hpp */
19721980
19731981
SIMDJSON_PUSH_DISABLE_WARNINGS
1974-
#if defined(_MSC_VER) && defined(__clang__)
1975-
SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include)
1976-
#endif
1982+
SIMDJSON_DISABLE_UNDESIRED_WARNINGS
19771983
19781984
// Public API
19791985
/* begin file include/simdjson/simdjson_version.h */

src/simdjson.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#include "simdjson.h"
22

33
SIMDJSON_PUSH_DISABLE_WARNINGS
4-
#if defined(SIMDJSON_CLANG_VISUAL_STUDIO)
5-
SIMDJSON_DISABLE_GCC_WARNING(-Wmicrosoft-include)
6-
#endif
4+
SIMDJSON_DISABLE_UNDESIRED_WARNINGS
75

86
#include "error.cpp"
97
#include "implementation.cpp"

0 commit comments

Comments
 (0)