Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
6ac037c1
Unverified
Commit
6ac037c1
authored
Aug 13, 2021
by
Niels Lohmann
Committed by
GitHub
Aug 13, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2930 from nlohmann/msvc_warnings_as_error
parents
e5ef44c4
4b0e04eb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
16 deletions
+20
-16
.github/workflows/windows.yml
.github/workflows/windows.yml
+7
-7
appveyor.yml
appveyor.yml
+7
-7
test/src/unit-allocator.cpp
test/src/unit-allocator.cpp
+1
-0
test/src/unit-deserialization.cpp
test/src/unit-deserialization.cpp
+1
-1
test/src/unit-udt.cpp
test/src/unit-udt.cpp
+4
-1
No files found.
.github/workflows/windows.yml
View file @
6ac037c1
...
@@ -37,13 +37,13 @@ jobs:
...
@@ -37,13 +37,13 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
cmake
-
name
:
cmake
run
:
cmake -S . -B build -G "Visual Studio 15 2017" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DCMAKE_EXE_LINKER_FLAGS="/STACK:4000000"
run
:
cmake -S . -B build -G "Visual Studio 15 2017" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DCMAKE_EXE_LINKER_FLAGS="/STACK:4000000"
-DCMAKE_CXX_FLAGS="/W4 /WX"
if
:
matrix.build_type == 'Release' && matrix.architecture == 'x64'
if
:
matrix.build_type == 'Release' && matrix.architecture == 'x64'
-
name
:
cmake
-
name
:
cmake
run
:
cmake -S . -B build -G "Visual Studio 15 2017" -A ${{ matrix.architecture }} -DJSON_BuildTests=On
run
:
cmake -S . -B build -G "Visual Studio 15 2017" -A ${{ matrix.architecture }} -DJSON_BuildTests=On
-DCMAKE_CXX_FLAGS="/W4 /WX"
if
:
matrix.build_type == 'Release' && matrix.architecture != 'x64'
if
:
matrix.build_type == 'Release' && matrix.architecture != 'x64'
-
name
:
cmake
-
name
:
cmake
run
:
cmake -S . -B build -G "Visual Studio 15 2017" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DJSON_FastTests=ON
run
:
cmake -S . -B build -G "Visual Studio 15 2017" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DJSON_FastTests=ON
-DCMAKE_CXX_FLAGS="/W4 /WX"
if
:
matrix.build_type == 'Debug'
if
:
matrix.build_type == 'Debug'
-
name
:
build
-
name
:
build
run
:
cmake --build build --config ${{ matrix.build_type }} --parallel
10
run
:
cmake --build build --config ${{ matrix.build_type }} --parallel
10
...
@@ -56,7 +56,7 @@ jobs:
...
@@ -56,7 +56,7 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
cmake
-
name
:
cmake
run
:
cmake -S . -B build -G "Visual Studio 15 2017" -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8 /W4"
run
:
cmake -S . -B build -G "Visual Studio 15 2017" -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8 /W4
/WX
"
-
name
:
build
-
name
:
build
run
:
cmake --build build --config Release --parallel
10
run
:
cmake --build build --config Release --parallel
10
-
name
:
test
-
name
:
test
...
@@ -72,10 +72,10 @@ jobs:
...
@@ -72,10 +72,10 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
cmake
-
name
:
cmake
run
:
cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -DJSON_BuildTests=On
run
:
cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -DJSON_BuildTests=On
-DCMAKE_CXX_FLAGS="/W4 /WX"
if
:
matrix.build_type == 'Release'
if
:
matrix.build_type == 'Release'
-
name
:
cmake
-
name
:
cmake
run
:
cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DJSON_FastTests=ON
run
:
cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DJSON_FastTests=ON
-DCMAKE_CXX_FLAGS="/W4 /WX"
if
:
matrix.build_type == 'Debug'
if
:
matrix.build_type == 'Debug'
-
name
:
build
-
name
:
build
run
:
cmake --build build --config ${{ matrix.build_type }} --parallel
10
run
:
cmake --build build --config ${{ matrix.build_type }} --parallel
10
...
@@ -88,7 +88,7 @@ jobs:
...
@@ -88,7 +88,7 @@ jobs:
steps
:
steps
:
-
uses
:
actions/checkout@v2
-
uses
:
actions/checkout@v2
-
name
:
cmake
-
name
:
cmake
run
:
cmake -S . -B build -G "Visual Studio 16 2019" -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8 /W4"
run
:
cmake -S . -B build -G "Visual Studio 16 2019" -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8 /W4
/WX
"
-
name
:
build
-
name
:
build
run
:
cmake --build build --config Release --parallel
10
run
:
cmake --build build --config Release --parallel
10
-
name
:
test
-
name
:
test
...
...
appveyor.yml
View file @
6ac037c1
...
@@ -5,7 +5,7 @@ environment:
...
@@ -5,7 +5,7 @@ environment:
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2015
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2015
configuration
:
Debug
configuration
:
Debug
platform
:
x86
platform
:
x86
CXX_FLAGS
:
"
"
CXX_FLAGS
:
"
/W4
/WX
"
LINKER_FLAGS
:
"
"
LINKER_FLAGS
:
"
"
CMAKE_OPTIONS
:
"
"
CMAKE_OPTIONS
:
"
"
GENERATOR
:
Visual Studio 14
2015
GENERATOR
:
Visual Studio 14
2015
...
@@ -13,7 +13,7 @@ environment:
...
@@ -13,7 +13,7 @@ environment:
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2015
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2015
configuration
:
Release
configuration
:
Release
platform
:
x86
platform
:
x86
CXX_FLAGS
:
"
"
CXX_FLAGS
:
"
/W4
/WX
"
LINKER_FLAGS
:
"
"
LINKER_FLAGS
:
"
"
CMAKE_OPTIONS
:
"
"
CMAKE_OPTIONS
:
"
"
GENERATOR
:
Visual Studio 14
2015
GENERATOR
:
Visual Studio 14
2015
...
@@ -22,7 +22,7 @@ environment:
...
@@ -22,7 +22,7 @@ environment:
configuration
:
Release
configuration
:
Release
platform
:
x86
platform
:
x86
name
:
with_win_header
name
:
with_win_header
CXX_FLAGS
:
"
"
CXX_FLAGS
:
"
/W4
/WX
"
LINKER_FLAGS
:
"
"
LINKER_FLAGS
:
"
"
CMAKE_OPTIONS
:
"
"
CMAKE_OPTIONS
:
"
"
GENERATOR
:
Visual Studio 14
2015
GENERATOR
:
Visual Studio 14
2015
...
@@ -30,7 +30,7 @@ environment:
...
@@ -30,7 +30,7 @@ environment:
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2017
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2017
configuration
:
Release
configuration
:
Release
platform
:
x86
platform
:
x86
CXX_FLAGS
:
"
/permissive-
/std:c++latest
/utf-8"
CXX_FLAGS
:
"
/permissive-
/std:c++latest
/utf-8
/W4
/WX
"
LINKER_FLAGS
:
"
"
LINKER_FLAGS
:
"
"
CMAKE_OPTIONS
:
"
"
CMAKE_OPTIONS
:
"
"
GENERATOR
:
Visual Studio 15
2017
GENERATOR
:
Visual Studio 15
2017
...
@@ -38,7 +38,7 @@ environment:
...
@@ -38,7 +38,7 @@ environment:
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2019
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2019
configuration
:
Release
configuration
:
Release
platform
:
x86
platform
:
x86
CXX_FLAGS
:
"
"
CXX_FLAGS
:
"
/W4
/WX
"
LINKER_FLAGS
:
"
"
LINKER_FLAGS
:
"
"
CMAKE_OPTIONS
:
"
-DJSON_ImplicitConversions=OFF"
CMAKE_OPTIONS
:
"
-DJSON_ImplicitConversions=OFF"
GENERATOR
:
Visual Studio 16
2019
GENERATOR
:
Visual Studio 16
2019
...
@@ -46,7 +46,7 @@ environment:
...
@@ -46,7 +46,7 @@ environment:
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2015
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2015
configuration
:
Release
configuration
:
Release
platform
:
x64
platform
:
x64
CXX_FLAGS
:
"
"
CXX_FLAGS
:
"
/W4
/WX
"
LINKER_FLAGS
:
"
"
LINKER_FLAGS
:
"
"
CMAKE_OPTIONS
:
"
"
CMAKE_OPTIONS
:
"
"
GENERATOR
:
Visual Studio 14
2015
GENERATOR
:
Visual Studio 14
2015
...
@@ -54,7 +54,7 @@ environment:
...
@@ -54,7 +54,7 @@ environment:
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2017
-
APPVEYOR_BUILD_WORKER_IMAGE
:
Visual Studio
2017
configuration
:
Release
configuration
:
Release
platform
:
x64
platform
:
x64
CXX_FLAGS
:
"
/permissive-
/std:c++latest
/Zc:__cplusplus
/utf-8
/F4000000"
CXX_FLAGS
:
"
/permissive-
/std:c++latest
/Zc:__cplusplus
/utf-8
/F4000000
/W4
/WX
"
LINKER_FLAGS
:
"
/STACK:4000000"
LINKER_FLAGS
:
"
/STACK:4000000"
CMAKE_OPTIONS
:
"
"
CMAKE_OPTIONS
:
"
"
GENERATOR
:
Visual Studio 15
2017
GENERATOR
:
Visual Studio 15
2017
...
...
test/src/unit-allocator.cpp
View file @
6ac037c1
...
@@ -108,6 +108,7 @@ struct my_allocator : std::allocator<T>
...
@@ -108,6 +108,7 @@ struct my_allocator : std::allocator<T>
throw
std
::
bad_alloc
();
throw
std
::
bad_alloc
();
}
}
static_cast
<
void
>
(
p
);
// fix MSVC's C4100 warning
p
->~
T
();
p
->~
T
();
}
}
...
...
test/src/unit-deserialization.cpp
View file @
6ac037c1
...
@@ -1089,7 +1089,7 @@ TEST_CASE_TEMPLATE("deserialization of different character types (UTF-8)", T,
...
@@ -1089,7 +1089,7 @@ TEST_CASE_TEMPLATE("deserialization of different character types (UTF-8)", T,
char
,
unsigned
char
,
std
::
uint8_t
)
char
,
unsigned
char
,
std
::
uint8_t
)
{
{
// a star emoji
// a star emoji
std
::
vector
<
T
>
v
=
{
'"'
,
static_cast
<
T
>
(
0xe2
),
static_cast
<
T
>
(
0xad
),
static_cast
<
T
>
(
0x90
),
static_cast
<
T
>
(
0xef
),
static_cast
<
T
>
(
0xb8
),
static_cast
<
T
>
(
0x8f
),
'"'
};
std
::
vector
<
T
>
v
=
{
'"'
,
static_cast
<
T
>
(
0xe2
u
),
static_cast
<
T
>
(
0xadu
),
static_cast
<
T
>
(
0x90u
),
static_cast
<
T
>
(
0xefu
),
static_cast
<
T
>
(
0xb8u
),
static_cast
<
T
>
(
0x8fu
),
'"'
};
CHECK
(
json
::
parse
(
v
).
dump
(
-
1
,
' '
,
true
)
==
"
\"\\
u2b50
\\
ufe0f
\"
"
);
CHECK
(
json
::
parse
(
v
).
dump
(
-
1
,
' '
,
true
)
==
"
\"\\
u2b50
\\
ufe0f
\"
"
);
CHECK
(
json
::
accept
(
v
));
CHECK
(
json
::
accept
(
v
));
...
...
test/src/unit-udt.cpp
View file @
6ac037c1
...
@@ -816,7 +816,10 @@ class Evil
...
@@ -816,7 +816,10 @@ class Evil
public:
public:
Evil
()
=
default
;
Evil
()
=
default
;
template
<
typename
T
>
template
<
typename
T
>
Evil
(
T
t
)
:
m_i
(
sizeof
(
t
))
{}
Evil
(
T
t
)
:
m_i
(
sizeof
(
t
))
{
static_cast
<
void
>
(
t
);
// fix MSVC's C4100 warning
}
int
m_i
=
0
;
int
m_i
=
0
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment