Skip to content

Commit be4a3f9

Browse files
committed
Add GNUC -Wconversion, -Wsign-conversion warnings
1 parent 4ee16a7 commit be4a3f9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

include/nonstd/string_view.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#define nssv_CPP17_OR_GREATER (__cplusplus >= 201703L || nssv_MSVC_LANG >= 201703L )
6969
#define nssv_CPP20_OR_GREATER (__cplusplus >= 202000L || nssv_MSVC_LANG >= 202000L )
7070

71-
// use C++17 std::string_view if available:
71+
// use C++17 std::string_view if available and requested:
7272

7373
#if defined(__has_include)
7474
# define nssv_HAS_INCLUDE( arg ) __has_include( arg )

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" )
6565
set( HAS_STD_FLAGS TRUE )
6666
set( HAS_CPP98_FLAG TRUE )
6767

68-
set( OPTIONS -Wall -Wno-missing-braces -Wno-unnamed-type-template-args -fno-elide-constructors )
68+
set( OPTIONS -Wall -Wextra -Wconversion -Wsign-conversion -Wno-missing-braces -Wno-unnamed-type-template-args -fno-elide-constructors )
6969
set( DEFINITIONS ${DEFCMN} )
7070

7171
# GNU: available -std flags depends on version

test/tg.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@setlocal
22
@set std=%1
33
@if "%std%"=="" set std=c++11
4-
g++ -std=%std% -O2 -Wall -Wextra -Wno-unused-parameter -Dnssv_CONFIG_STD_SV_OPERATOR=1 -Dnssv_CONFIG_USR_SV_OPERATOR=1 -Dnssv_STRING_VIEW_HEADER=\"string_view.hpp\" -I../include/nonstd -o string-view-lite.t.exe string-view-lite.t.cpp string-view.t.cpp && string-view-lite.t.exe
4+
g++ -std=%std% -O2 -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wno-unused-parameter -Dnssv_CONFIG_STD_SV_OPERATOR=1 -Dnssv_CONFIG_USR_SV_OPERATOR=1 -Dnssv_STRING_VIEW_HEADER=\"string_view.hpp\" -I../include/nonstd -o string-view-lite.t.exe string-view-lite.t.cpp string-view.t.cpp && string-view-lite.t.exe
55
@endlocal
66

0 commit comments

Comments
 (0)