Skip to content

Commit

Permalink
Disable buggy warnings (#65542)
Browse files Browse the repository at this point in the history
* Rename variable called requires

As this is a keyword in C++20, it should be used
to name a variable.

* Disable dangling reference warning

GCC 13 reports false positives of this warning.

* Disable c++20 compatibility warnings

As suggested by andrei8l
  • Loading branch information
Arkaeriit authored May 30, 2023
1 parent a56edc8 commit 9ffcd2b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ WARNINGS = \
-Wsuggest-override \
-Wunused-macros \
-Wzero-as-null-pointer-constant \
-Wno-unknown-warning-option
-Wno-unknown-warning-option \
-Wno-dangling-reference \
-Wno-c++20-compat
# Uncomment below to disable warnings
#WARNINGS = -w
DEBUGSYMS = -g
Expand Down
4 changes: 2 additions & 2 deletions src/faction_camp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2575,8 +2575,8 @@ static int salt_water_pipe_segment_of( const recipe &making );
int salt_water_pipe_segment_of( const recipe &making )
{
int segment_number = -1;
const auto &requires = making.blueprint_requires();
for( auto const &element : requires ) {
const auto &requirements = making.blueprint_requires();
for( auto const &element : requirements ) {
if( element.first.substr( 0, salt_water_pipe_string_base.length() ) == salt_water_pipe_string_base
&&
element.first.substr( element.first.length() - salt_water_pipe_string_suffix.length(),
Expand Down

0 comments on commit 9ffcd2b

Please sign in to comment.