Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pull request CleverRaven#38044 from jbytheway/missing_noreturn #86

Merged
merged 4 commits into from
Feb 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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