File tree 14 files changed +960
-911
lines changed 14 files changed +960
-911
lines changed Original file line number Diff line number Diff line change 2
2
#define __BENCHMARKER_H
3
3
4
4
#include " event_counter.h"
5
+ #include " simdjson.h" // For SIMDJSON_DISABLE_DEPRECATED_WARNINGS
5
6
6
7
#include < cassert>
7
8
#include < cctype>
@@ -435,7 +436,11 @@ struct benchmarker {
435
436
void print (bool tabbed_output) const {
436
437
if (tabbed_output) {
437
438
char * filename_copy = (char *)malloc (strlen (filename)+1 );
439
+ SIMDJSON_PUSH_DISABLE_WARNINGS
440
+ SIMDJSON_DISABLE_DEPRECATED_WARNING // Validated CRT_SECURE safe here
438
441
strcpy (filename_copy, filename);
442
+ SIMDJSON_POP_DISABLE_WARNINGS
443
+
439
444
#if defined(__linux__)
440
445
char * base = ::basename (filename_copy);
441
446
#else
Original file line number Diff line number Diff line change 11
11
#include "simdjson/common_defs.h"
12
12
13
13
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
17
15
18
16
// Public API
19
17
#include "simdjson/simdjson_version.h"
Original file line number Diff line number Diff line change @@ -77,9 +77,12 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024;
77
77
#define unlikely (x ) x
78
78
#endif
79
79
80
+ #include < CppCoreCheck\Warnings.h>
80
81
#define SIMDJSON_PUSH_DISABLE_WARNINGS __pragma (warning( push ))
81
82
#define SIMDJSON_PUSH_DISABLE_ALL_WARNINGS __pragma (warning( push, 0 ))
82
83
#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)
83
86
#define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_VS_WARNING (4996 )
84
87
#define SIMDJSON_POP_DISABLE_WARNINGS __pragma (warning( pop ))
85
88
@@ -113,6 +116,11 @@ constexpr size_t DEFAULT_MAX_DEPTH = 1024;
113
116
SIMDJSON_DISABLE_GCC_WARNING(-Wunused-variable)
114
117
#define SIMDJSON_PRAGMA (P) _Pragma(#P)
115
118
#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
116
124
#define SIMDJSON_DISABLE_DEPRECATED_WARNING SIMDJSON_DISABLE_GCC_WARNING (-Wdeprecated-declarations)
117
125
#define SIMDJSON_POP_DISABLE_WARNINGS _Pragma (" GCC diagnostic pop" )
118
126
Original file line number Diff line number Diff line change @@ -339,7 +339,11 @@ inline bool parser::dump_raw_tape(std::ostream &os) const noexcept {
339
339
340
340
inline simdjson_result<size_t > parser::read_file (const std::string &path) noexcept {
341
341
// Open the file
342
+ SIMDJSON_PUSH_DISABLE_WARNINGS
343
+ SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe
342
344
std::FILE *fp = std::fopen (path.c_str (), " rb" );
345
+ SIMDJSON_POP_DISABLE_WARNINGS
346
+
343
347
if (fp == nullptr ) {
344
348
return IO_ERROR;
345
349
}
Original file line number Diff line number Diff line change @@ -102,7 +102,11 @@ inline padded_string::operator std::string_view() const { return std::string_vie
102
102
103
103
inline simdjson_result<padded_string> padded_string::load (const std::string &filename) noexcept {
104
104
// Open the file
105
+ SIMDJSON_PUSH_DISABLE_WARNINGS
106
+ SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe
105
107
std::FILE *fp = std::fopen (filename.c_str (), " rb" );
108
+ SIMDJSON_POP_DISABLE_WARNINGS
109
+
106
110
if (fp == nullptr ) {
107
111
return IO_ERROR;
108
112
}
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ add_library(simdjson-internal-flags INTERFACE)
39
39
target_link_libraries (simdjson-internal -flags INTERFACE simdjson-flags )
40
40
41
41
if (MSVC )
42
- target_compile_options (simdjson-internal -flags INTERFACE /nologo /D_CRT_SECURE_NO_WARNINGS)
43
42
target_compile_options (simdjson-internal -flags INTERFACE /WX /W3 /sdl)
44
43
else ()
45
44
target_compile_options (simdjson-internal -flags INTERFACE -fPIC)
You can’t perform that action at this time.
0 commit comments