summaryrefslogtreecommitdiff
path: root/src/core/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Lioncash2021-05-16 01:46:30 -0400
committerGravatar Lioncash2021-05-16 03:43:16 -0400
commit9a07ed53ebe4e27ef1a14e0469037cab9fb7b1e7 (patch)
tree54d6c5a6b319a10522b068caf2b0600c8f27876a /src/core/CMakeLists.txt
parentMerge pull request #6316 from ameerj/title-fix (diff)
downloadyuzu-9a07ed53ebe4e27ef1a14e0469037cab9fb7b1e7.tar.gz
yuzu-9a07ed53ebe4e27ef1a14e0469037cab9fb7b1e7.tar.xz
yuzu-9a07ed53ebe4e27ef1a14e0469037cab9fb7b1e7.zip
core: Make variable shadowing a compile-time error
Now that we have most of core free of shadowing, we can enable the warning as an error to catch anything that may be remaining and also eliminate this class of logic bug entirely.
Diffstat (limited to 'src/core/CMakeLists.txt')
-rw-r--r--src/core/CMakeLists.txt26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 83da30418..efb851f5a 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -651,20 +651,17 @@ endif()
651 651
652if (MSVC) 652if (MSVC)
653 target_compile_options(core PRIVATE 653 target_compile_options(core PRIVATE
654 # 'expression' : signed/unsigned mismatch 654 /we4018 # 'expression' : signed/unsigned mismatch
655 /we4018 655 /we4244 # 'argument' : conversion from 'type1' to 'type2', possible loss of data (floating-point)
656 # 'argument' : conversion from 'type1' to 'type2', possible loss of data (floating-point) 656 /we4245 # 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
657 /we4244 657 /we4254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
658 # 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch 658 /we4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data
659 /we4245 659 /we4305 # 'context' : truncation from 'type1' to 'type2'
660 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data 660 /we4456 # Declaration of 'identifier' hides previous local declaration
661 /we4254 661 /we4457 # Declaration of 'identifier' hides function parameter
662 # 'var' : conversion from 'size_t' to 'type', possible loss of data 662 /we4458 # Declaration of 'identifier' hides class member
663 /we4267 663 /we4459 # Declaration of 'identifier' hides global declaration
664 # 'context' : truncation from 'type1' to 'type2' 664 /we4715 # 'function' : not all control paths return a value
665 /we4305
666 # 'function' : not all control paths return a value
667 /we4715
668 ) 665 )
669else() 666else()
670 target_compile_options(core PRIVATE 667 target_compile_options(core PRIVATE
@@ -672,6 +669,7 @@ else()
672 -Werror=ignored-qualifiers 669 -Werror=ignored-qualifiers
673 -Werror=implicit-fallthrough 670 -Werror=implicit-fallthrough
674 -Werror=sign-compare 671 -Werror=sign-compare
672 -Werror=shadow
675 673
676 $<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess> 674 $<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess>
677 $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter> 675 $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>