Skip to content

Commit

Permalink
Merge pull request #86 from CleverRaven/master
Browse files Browse the repository at this point in the history
Merge pull request CleverRaven#38044 from jbytheway/missing_noreturn
  • Loading branch information
fengjixuchui authored Feb 16, 2020
2 parents 7608a2f + 71ebc26 commit e06a676
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,12 @@ ELSE()
SET(CATA_WARNINGS
"-Werror -Wall -Wextra \
-Wmissing-declarations \
-Wmissing-noreturn \
-Wold-style-cast \
-Woverloaded-virtual \
-Wsuggest-override \
-Wno-unknown-warning-option \
-Wpedantic")
-Wpedantic \
-Wno-unknown-warning-option")
# Compact the whitespace in the warning string
string(REGEX REPLACE "[\t ]+" " " CATA_WARNINGS "${CATA_WARNINGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CATA_WARNINGS}")
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ RELEASE_FLAGS =
WARNINGS = \
-Werror -Wall -Wextra \
-Wmissing-declarations \
-Wmissing-noreturn \
-Wold-style-cast \
-Woverloaded-virtual \
-Wpedantic \
-Wsuggest-override \
-Wno-unknown-warning-option \
-Wpedantic
-Wno-unknown-warning-option
# Uncomment below to disable warnings
#WARNINGS = -w
DEBUGSYMS = -g
Expand Down
7 changes: 3 additions & 4 deletions src/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ class JsonIn
} catch( const io::InvalidEnumString & ) {
seek( old_offset ); // so the error message points to the correct place.
error( "invalid enumeration value" );
throw; // ^^ error already throws, but the compiler doesn't know that )-:
}
}

Expand Down Expand Up @@ -1013,8 +1012,8 @@ class JsonArray
size_t size() const;
bool empty();
std::string str(); // copy array json as string
void throw_error( std::string err );
void throw_error( std::string err, int idx );
[[noreturn]] void throw_error( std::string err );
[[noreturn]] void throw_error( std::string err, int idx );

// iterative access
bool next_bool();
Expand Down Expand Up @@ -1138,7 +1137,7 @@ class JsonValue
return seek().test_array();
}

void throw_error( const std::string &err ) const {
[[noreturn]] void throw_error( const std::string &err ) const {
seek().error( err );
}

Expand Down
2 changes: 1 addition & 1 deletion src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3409,7 +3409,7 @@ static void init_term_size_and_scaling_factor()

int max_width, max_height;

int current_display_id = get_option<int>( "DISPLAY" );
int current_display_id = std::stoi( get_option<std::string>( "DISPLAY" ) );
SDL_DisplayMode current_display;

if( SDL_GetDesktopDisplayMode( current_display_id, &current_display ) == 0 ) {
Expand Down

0 comments on commit e06a676

Please sign in to comment.