Skip to content

Commit 5663fbb

Browse files
committed
Merge branch 'develop' into breaking
Manual Resolved Conflicts: Changelog.md * Updated changelog test/externalTests/ens.sh * Merged fixes for upstream from both develop and breaking test/libsolidity/semanticTests/inlineAssembly/external_identifier_access_shadowing.sol * Removed in #11735 (breaking) test/libsolidity/semanticTests/inlineAssembly/function_name_clash.sol * Removed in #12209 (breaking) test/libsolidity/semanticTests/storage/mappings_array2d_pop_delete.sol * Removed in #11843 (breaking) test/libsolidity/semanticTests/storage/mappings_array_pop_delete.sol * Removed in #11843 (breaking) test/libsolidity/syntaxTests/inlineAssembly/basefee_berlin_function.sol * Used version of file from #11842 (breaking)
2 parents 777385f + ecdc808 commit 5663fbb

File tree

1,924 files changed

+11925
-5616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,924 files changed

+11925
-5616
lines changed

.circleci/config.yml

+196-56
Large diffs are not rendered by default.

.circleci/osx_install_dependencies.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ then
6161
./scripts/install_obsolete_jsoncpp_1_7_4.sh
6262

6363
# z3
64-
z3_version="4.8.17"
64+
z3_version="4.11.0"
6565
z3_dir="z3-${z3_version}-x64-osx-10.16"
6666
z3_package="${z3_dir}.zip"
6767
wget "https://github.com/Z3Prover/z3/releases/download/z3-${z3_version}/${z3_package}"
68-
validate_checksum "$z3_package" 189667930517aee07f1ce36485d5924a9a2cb4f8c3c9586b03e714a2c657541a
68+
validate_checksum "$z3_package" b6a4a6d587e4bfb0643db81129f0f447692fae13d4bd1bd4d93f1c0301b75ffc
6969
unzip "$z3_package"
7070
rm "$z3_package"
7171
cp "${z3_dir}/bin/libz3.a" /usr/local/lib

.circleci/soltest.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cd "$PSScriptRoot\.."
66
if ( -not $? ) { throw "Cannot execute solc --version." }
77

88
mkdir test_results
9-
.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result.xml -- --no-smt
9+
.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result.xml --logger=HRF,error,stdout -- --no-smt
1010
if ( -not $? ) { throw "Unoptimized soltest run failed." }
11-
.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result_opt.xml -- --optimize --no-smt
12-
if ( -not $? ) { throw "Optimized soltest run failed." }
11+
.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result_opt.xml --logger=HRF,error,stdout -- --optimize --no-smt
12+
if ( -not $? ) { throw "Optimized soltest run failed." }

.circleci/soltest.sh

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ do
7575
"--color_output=no"
7676
"--show_progress=yes"
7777
"--logger=JUNIT,error,test_results/$(get_logfile_basename "$((CPUs * CIRCLE_NODE_INDEX + run))").xml"
78+
"--logger=HRF,error,stdout"
7879
"${BOOST_TEST_ARGS[@]}"
7980
)
8081
SOLTEST_ARGS=("--evm-version=$EVM" "${SOLTEST_FLAGS[@]}")

.github/ISSUE_TEMPLATE/config.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Bug Report
4-
url: https://github.com/ethereum/solidity/issues/new?template=bug_report.md&projects=ethereum/solidity/43&labels=bug+%3Abug%3A
5-
about: Bug reports about the Solidity Compiler.
4+
url: https://github.com/ethereum/solidity/issues/new?template=bug_report.md&projects=ethereum/solidity/43
5+
about: Bug reports for the Solidity Compiler.
66
- name: Documentation Issue
7-
url: https://github.com/ethereum/solidity/issues/new?template=documentation_issue.md&projects=ethereum/solidity/43&labels=documentation+%3Abook%3A
7+
url: https://github.com/ethereum/solidity/issues/new?template=documentation_issue.md&projects=ethereum/solidity/43
88
about: Solidity documentation.
99
- name: Feature Request
10-
url: https://github.com/ethereum/solidity/issues/new?template=feature_request.md&projects=ethereum/solidity/43&labels=feature
10+
url: https://github.com/ethereum/solidity/issues/new?template=feature_request.md&projects=ethereum/solidity/43
1111
about: Solidity language or infrastructure feature requests.
1212
- name: Report a security vulnerability
1313
url: https://github.com/ethereum/solidity/security/policy
1414
about: Please review our security policy for more details.
15+
- name: Initiate a language design or feedback discussion
16+
url: https://forum.soliditylang.org
17+
about: Open a thread on the Solidity forum.

.github/ISSUE_TEMPLATE/feature_request.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ name: Feature Request
1010
- [Solidity chat](https://gitter.im/ethereum/solidity)
1111
- [Stack Overflow](https://ethereum.stackexchange.com/)
1212
- Ensure the issue isn't already reported (check `feature` and `language design` labels).
13+
- If you feel uncertain about your feature request, perhaps it's better to open a language design or feedback forum thread via the issue selector, or by going to the forum directly.
14+
- [Solidity forum](https://forum.soliditylang.org/)
1315
1416
*Delete the above section and the instructions in the sections below before submitting*
1517
-->

.github/workflows/buildpack-deps.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
3838
- name: comment PR
3939
if: "env.DOCKER_IMAGE"
40-
uses: aarlt/[email protected]
40+
# NOTE: Can't update to v1.3.1 due to an error: `/entrypoint.sh:5:in 'require_relative': cannot load such file -- /lib/github (LoadError)`
41+
uses: unsplash/comment-on-pr@ffe8f97ccc63ce12c3c23c6885b169db67958d3b #v1.3.0
4142
with:
42-
msg: "`${{ env.DOCKER_IMAGE }} ${{ env.DOCKER_REPO_DIGEST }}`."
43+
msg: "`${{ env.DOCKER_IMAGE }} ${{ env.DOCKER_REPO_DIGEST }}`."
44+
check_for_duplicate_msg: false
45+

.gitignore

+14-20
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
commit_hash.txt
2-
prerelease.txt
1+
/commit_hash.txt
2+
/prerelease.txt
3+
4+
# Auth config for ppa release
5+
/.release_ppa_auth
36

47
# Compiled Object files
58
*.slo
69
*.lo
710
*.o
811
*.obj
12+
*.pyc
13+
__pycache__
914

1015
# Precompiled Headers
1116
*.gch
@@ -16,9 +21,6 @@ prerelease.txt
1621
*.dylib
1722
*.dll
1823

19-
# Fortran module files
20-
*.mod
21-
2224
# Compiled Static libraries
2325
*.lai
2426
*.la
@@ -33,14 +35,9 @@ prerelease.txt
3335
# Build directory
3436
/build*
3537
emscripten_build/
36-
docs/_build
37-
docs/_static/robots.txt
38-
__pycache__
39-
docs/utils/*.pyc
40-
/deps/downloads/
41-
deps/install
42-
deps/cache
43-
cmake-build-*/
38+
/docs/_build
39+
/docs/_static/robots.txt
40+
/deps
4441

4542
# vim stuff
4643
[._]*.sw[a-p]
@@ -50,18 +47,15 @@ cmake-build-*/
5047
*~
5148

5249
# IDE files
53-
.idea
54-
.vscode
55-
browse.VC.db
56-
CMakeLists.txt.user
50+
/.idea/
51+
/.vscode/
52+
/browse.VC.db
53+
/CMakeLists.txt.user
5754
/CMakeSettings.json
5855
/.vs
5956
/.cproject
6057
/.project
6158

62-
# place to put local temporary files
63-
tmp
64-
6559
# OS specific local files
6660
.DS_Store
6761
Thumbs.db

CMakeLists.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ include(EthPolicy)
2121
eth_policy()
2222

2323
# project name and version should be set after cmake_policy CMP0048
24-
set(PROJECT_VERSION "0.8.15")
24+
set(PROJECT_VERSION "0.8.17")
2525
# OSX target needed in order to support std::visit
2626
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14")
2727
project(solidity VERSION ${PROJECT_VERSION} LANGUAGES C CXX)
@@ -35,6 +35,7 @@ endif()
3535
option(SOLC_LINK_STATIC "Link solc executable statically on supported platforms" OFF)
3636
option(SOLC_STATIC_STDLIBS "Link solc against static versions of libgcc and libstdc++ on supported platforms" OFF)
3737
option(STRICT_Z3_VERSION "Use the latest version of Z3" ON)
38+
option(PEDANTIC "Enable extra warnings and pedantic build flags. Treat all warnings as errors." ON)
3839

3940
# Setup cccache.
4041
include(EthCcache)
@@ -48,6 +49,9 @@ include_directories(SYSTEM ${JSONCPP_INCLUDE_DIR})
4849

4950
find_package(Threads)
5051

52+
if(NOT PEDANTIC)
53+
message(WARNING "-- Pedantic build flags turned off. Warnings will not make compilation fail. This is NOT recommended in development builds.")
54+
endif()
5155
# Figure out what compiler and system are we using
5256
include(EthCompilerSettings)
5357

@@ -65,7 +69,7 @@ configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/license.h.in" include/licens
6569

6670
include(EthOptions)
6771
configure_project(TESTS)
68-
set(LATEST_Z3_VERSION "4.8.17")
72+
set(LATEST_Z3_VERSION "4.11.0")
6973
set(MINIMUM_Z3_VERSION "4.8.0")
7074
find_package(Z3)
7175
if (${Z3_FOUND})

Changelog.md

+57-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,69 @@ Breaking changes:
1111
* View Pure Checker: Mark ``returndatasize`` and ``returndatacopy`` as view to disallow them in inline assembly blocks in pure functions.
1212

1313

14-
### 0.8.15 (unreleased)
14+
### 0.8.17 (unreleased)
15+
16+
Important Bugfixes:
17+
1518

1619
Language Features:
1720

1821

1922
Compiler Features:
23+
* Code Generator: More efficient overflow checks for multiplication.
24+
* Yul Optimizer: Simplify the starting offset of zero-length operations to zero.
25+
* Language Server: Analyze all files in a project by default (can be customized by setting ``'file-load-strategy'`` to ``'directly-opened-and-on-import'`` in LSP settings object).
26+
27+
28+
Bugfixes:
29+
* Type Checker: Fix internal compiler error on tuple assignments with invalid left-hand side.
30+
31+
32+
### 0.8.16 (2022-08-08)
33+
34+
Important Bugfixes:
35+
* Code Generation: Fix data corruption that affected ABI-encoding of calldata values represented by tuples: structs at any nesting level; argument lists of external functions, events and errors; return value lists of external functions. The 32 leading bytes of the first dynamically-encoded value in the tuple would get zeroed when the last component contained a statically-encoded array.
36+
37+
38+
Compiler Features:
39+
* Code Generator: More efficient code for checked addition and subtraction.
40+
* TypeChecker: Support using library constants in initializers of other constants.
41+
* Yul IR Code Generation: Improved copy routines for arrays with packed storage layout.
42+
* Yul Optimizer: Add rule to convert ``mod(add(X, Y), A)`` into ``addmod(X, Y, A)``, if ``A`` is a power of two.
43+
* Yul Optimizer: Add rule to convert ``mod(mul(X, Y), A)`` into ``mulmod(X, Y, A)``, if ``A`` is a power of two.
2044

2145

2246
Bugfixes:
47+
* Commandline Interface: Disallow the following options outside of the compiler mode: ``--via-ir``,``--metadata-literal``, ``--metadata-hash``, ``--model-checker-show-unproved``, ``--model-checker-div-mod-no-slacks``, ``--model-checker-engine``, ``--model-checker-invariants``, ``--model-checker-solvers``, ``--model-checker-timeout``, ``--model-checker-contracts``, ``--model-checker-targets``.
48+
* Type Checker: Fix compiler crash on tuple assignments involving certain patterns with unary tuples on the left-hand side.
49+
* Type Checker: Fix compiler crash when ``abi.encodeCall`` received a tuple expression instead of an inline tuple.
50+
* Type Checker: Fix null dereference in ``abi.encodeCall`` type checking of free function.
51+
52+
53+
### 0.8.15 (2022-06-15)
54+
55+
Important Bugfixes:
56+
* Code Generation: Avoid writing dirty bytes to storage when copying ``bytes`` arrays.
57+
* Yul Optimizer: Keep all memory side-effects of inline assembly blocks.
58+
59+
60+
Language Features:
61+
* Add `E.selector` for a non-anonymous event `E` to access the 32-byte selector topic.
62+
63+
64+
Compiler Features:
65+
* Language Server: Add rudimentary support for semantic highlighting.
66+
* Language Server: Adds support for configuring ``include-paths`` JSON settings object that can be passed during LSP configuration stage.
67+
* Language Server: Always add ``{project_root}/node_modules`` to include search paths.
68+
* Type Checker: Warn about assignments involving multiple pushes to storage ``bytes`` that may invalidate references.
69+
* Yul Optimizer: Improve inlining heuristics for via IR code generation and pure Yul compilation.
70+
71+
Bugfixes:
72+
* ABI Encoder: When encoding an empty string coming from storage do not add a superfluous empty slot for data.
73+
* Common Subexpression Eliminator: Process assembly items in chunks with maximum size of 2000. It helps to avoid extremely time-consuming searches during code optimization.
74+
* DocString Parser: Fix ICE caused by an immutable struct with mapping.
75+
* Yul IR Code Generation: More robust cleanup in corner cases during memory to storage copies.
76+
* Yul Optimizer: Do not remove ``returndatacopy`` in cases in which it might perform out-of-bounds reads that unconditionally revert as out-of-gas. Previously, any ``returndatacopy`` that wrote to memory that was never read from was removed without accounting for the out-of-bounds condition.
2377

2478

2579
### 0.8.14 (2022-05-17)
@@ -61,9 +115,10 @@ Compiler Features:
61115
* Commandline Interface: Allow the use of ``--via-ir`` in place of ``--experimental-via-ir``.
62116
* Compilation via Yul IR is no longer marked as experimental.
63117
* JSON-AST: Added selector field for errors and events.
64-
* LSP: Implements goto-definition.
118+
* Language Server: Implements goto-definition.
65119
* Peephole Optimizer: Optimize comparisons in front of conditional jumps and conditional jumps across a single unconditional jump.
66120
* Yul EVM Code Transform: Avoid unnecessary ``pop``s on terminating control flow.
121+
* Yul IR Code Generation: When the result of an external call is statically-sized, ignore any returndata past the size expected by the compiler.
67122
* Yul Optimizer: Remove ``sstore`` and ``mstore`` operations that are never read from.
68123

69124

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ For a good overview and starting point, please check out the official [Solidity
2727

2828
Solidity is a statically-typed curly-braces programming language designed for developing smart contracts
2929
that run on the Ethereum Virtual Machine. Smart contracts are programs that are executed inside a peer-to-peer
30-
network where nobody has special authority over the execution, and thus they allow to implement tokens of value,
30+
network where nobody has special authority over the execution, and thus they allow anyone to implement tokens of value,
3131
ownership, voting, and other kinds of logic.
3232

3333
When deploying contracts, you should use the latest released version of

ReleaseChecklist.md

+5-18
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,16 @@
2626
- [ ] Click the `PUBLISH RELEASE` button on the release page, creating the tag.
2727
- [ ] Wait for the CI runs on the tag itself.
2828

29-
### Upload Release Artifacts
29+
### Upload Release Artifacts and Publish Binaries
3030
- [ ] Switch to the tag that archives have to be created for.
3131
- [ ] Create the ``prerelease.txt`` file: (``echo -n > prerelease.txt``).
3232
- [ ] Run ``scripts/create_source_tarball.sh`` while being on the tag to create the source tarball. This will create the tarball in a directory called ``upload``.
3333
- [ ] Take the tarball from the upload directory (its name should be ``solidity_x.x.x.tar.gz``, otherwise ``prerelease.txt`` was missing in the step before) and upload the source tarball to the release page.
34-
- [ ] Take the ``solc.exe`` binary from the ``b_win_release`` run of the released commit in circle-ci and add it to the release page as ``solc-windows.exe``.
35-
- [ ] Take the ``solc`` binary from the ``b_osx`` run of the released commit in circle-ci and add it to the release page as ``solc-macos``.
36-
- [ ] Take the ``solc`` binary from the ``b_ubu_static`` run of the released commit in circle-ci and add it to the release page as ``solc-static-linux``.
37-
- [ ] Take the ``soljson.js`` binary from the ``b_ems`` run of the released commit in circle-ci and add it to the release page as ``soljson.js``.
38-
39-
### Update [solc-bin](https://github.com/ethereum/solc-bin/)
40-
- [ ] Copy files to solc-bin:
41-
```bash
42-
VERSION=0.8.4
43-
COMMIT="c7e474f2"
44-
SOLC_BIN="/home/me/solc-bin"
45-
chmod +x solc-static-linux solc-macos
46-
cp soljson.js $SOLC_BIN/bin/soljson-v$VERSION+commit.$COMMIT.js
47-
cp solc-static-linux $SOLC_BIN/linux-amd64/solc-linux-amd64-v$VERSION+commit.$COMMIT
48-
cp solc-macos $SOLC_BIN/macosx-amd64/solc-macosx-amd64-v$VERSION+commit.$COMMIT
49-
cp solc-windows.exe $SOLC_BIN/windows-amd64/solc-windows-amd64-v$VERSION+commit.$COMMIT.exe
34+
- [ ] Take the ``github-binaries.tar`` tarball from ``c_release_binaries`` run of the tagged commit in circle-ci and add all binaries from it to the release page.
35+
Make sure it contains four binaries: ``solc-windows.exe``, ``solc-macos``, ``solc-static-linux`` and ``soljson.js``.
36+
- [ ] Take the ``solc-bin-binaries.tar`` tarball from ``c_release_binaries`` run of the tagged commit in circle-ci and add all binaries from it to solc-bin.
5037
- [ ] Run ``./update --reuse-hashes`` in ``solc-bin`` and verify that the script has updated ``list.js``, ``list.txt`` and ``list.json`` files correctly and that symlinks to the new release have been added in ``solc-bin/wasm/`` and ``solc-bin/emscripten-wasm32/``.
51-
- [ ] Create a pull request and merge.
38+
- [ ] Create a pull request in solc-bin and merge.
5239

5340
### Homebrew and MacOS
5441
- [ ] Update the version and the hash (``sha256sum solidity_$VERSION.tar.gz``) in https://github.com/Homebrew/homebrew-core/blob/master/Formula/solidity.rb

cmake/EthCompilerSettings.cmake

+33-23
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ if(NOT EMSCRIPTEN)
2323
endif()
2424
endif()
2525

26-
eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough)
26+
if(PEDANTIC)
27+
eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough)
28+
endif()
2729

2830
# Prevent the path of the source directory from ending up in the binary via __FILE__ macros.
2931
eth_add_cxx_compiler_flag_if_supported("-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=/solidity")
@@ -32,39 +34,45 @@ eth_add_cxx_compiler_flag_if_supported("-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=/
3234
# if the argument was not wrapped in a call. This happens when moving a local
3335
# variable in a return statement when the variable is the same type as the
3436
# return type or using a move to create a new object from a temporary object.
35-
eth_add_cxx_compiler_flag_if_supported(-Wpessimizing-move)
37+
if(PEDANTIC)
38+
eth_add_cxx_compiler_flag_if_supported(-Wpessimizing-move)
39+
endif()
3640

3741
# -Wredundant-move warns when an implicit move would already be made, so the
3842
# std::move call is not needed, such as when moving a local variable in a return
3943
# that is different from the return type.
40-
eth_add_cxx_compiler_flag_if_supported(-Wredundant-move)
44+
if(PEDANTIC)
45+
eth_add_cxx_compiler_flag_if_supported(-Wredundant-move)
46+
endif()
4147

4248
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
4349
# Enables all the warnings about constructions that some users consider questionable,
4450
# and that are easy to avoid. Also enable some extra warning flags that are not
4551
# enabled by -Wall. Finally, treat at warnings-as-errors, which forces developers
4652
# to fix warnings as they arise, so they don't accumulate "to be fixed later".
47-
add_compile_options(-Wall)
48-
add_compile_options(-Wextra)
49-
add_compile_options(-Werror)
50-
add_compile_options(-pedantic)
51-
add_compile_options(-Wmissing-declarations)
52-
add_compile_options(-Wno-unknown-pragmas)
53-
add_compile_options(-Wimplicit-fallthrough)
54-
add_compile_options(-Wsign-conversion)
55-
add_compile_options(-Wconversion)
53+
if(PEDANTIC)
54+
add_compile_options(-Wall)
55+
add_compile_options(-Wextra)
56+
add_compile_options(-Werror)
57+
add_compile_options(-pedantic)
58+
add_compile_options(-Wmissing-declarations)
59+
add_compile_options(-Wno-unknown-pragmas)
60+
add_compile_options(-Wimplicit-fallthrough)
61+
add_compile_options(-Wsign-conversion)
62+
add_compile_options(-Wconversion)
5663

57-
check_cxx_compiler_flag(-Wextra-semi WEXTRA_SEMI)
58-
if(WEXTRA_SEMI)
59-
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wextra-semi>)
64+
check_cxx_compiler_flag(-Wextra-semi WEXTRA_SEMI)
65+
if(WEXTRA_SEMI)
66+
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wextra-semi>)
67+
endif()
68+
eth_add_cxx_compiler_flag_if_supported(-Wfinal-dtor-non-final-class)
69+
eth_add_cxx_compiler_flag_if_supported(-Wnewline-eof)
70+
eth_add_cxx_compiler_flag_if_supported(-Wsuggest-destructor-override)
71+
eth_add_cxx_compiler_flag_if_supported(-Wduplicated-cond)
72+
eth_add_cxx_compiler_flag_if_supported(-Wduplicate-enum)
73+
eth_add_cxx_compiler_flag_if_supported(-Wlogical-op)
74+
eth_add_cxx_compiler_flag_if_supported(-Wno-unknown-attributes)
6075
endif()
61-
eth_add_cxx_compiler_flag_if_supported(-Wfinal-dtor-non-final-class)
62-
eth_add_cxx_compiler_flag_if_supported(-Wnewline-eof)
63-
eth_add_cxx_compiler_flag_if_supported(-Wsuggest-destructor-override)
64-
eth_add_cxx_compiler_flag_if_supported(-Wduplicated-cond)
65-
eth_add_cxx_compiler_flag_if_supported(-Wduplicate-enum)
66-
eth_add_cxx_compiler_flag_if_supported(-Wlogical-op)
67-
eth_add_cxx_compiler_flag_if_supported(-Wno-unknown-attributes)
6876

6977
# Configuration-specific compiler settings.
7078
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3 -DETH_DEBUG")
@@ -158,7 +166,9 @@ elseif (DEFINED MSVC)
158166

159167
add_compile_options(/MP) # enable parallel compilation
160168
add_compile_options(/EHsc) # specify Exception Handling Model in msvc
161-
add_compile_options(/WX) # enable warnings-as-errors
169+
if(PEDANTIC)
170+
add_compile_options(/WX) # enable warnings-as-errors
171+
endif()
162172
add_compile_options(/wd4068) # disable unknown pragma warning (4068)
163173
add_compile_options(/wd4996) # disable unsafe function warning (4996)
164174
add_compile_options(/wd4503) # disable decorated name length exceeded, name was truncated (4503)

0 commit comments

Comments
 (0)