Fix msvc warnings
This commit is contained in:
parent
7ee0beb343
commit
6372262304
@ -49,7 +49,8 @@ else()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(rexy PRIVATE "/Zc:__cplusplus" "/Wall")
|
||||
#make msvc update the __cplusplus macro to actually comply to c++ standard
|
||||
target_compile_options(rexy PRIVATE "/Zc:__cplusplus")
|
||||
else()
|
||||
target_compile_options(rexy PRIVATE "-Wall" "-Wextra" "-pedantic")
|
||||
endif()
|
||||
@ -70,7 +71,7 @@ endif()
|
||||
if(BUILD_TESTS)
|
||||
add_library(ensure OBJECT "src/ensure.cpp")
|
||||
if(MSVC)
|
||||
target_compile_options(ensure PRIVATE "/Zc:__cplusplus" "/Wall")
|
||||
target_compile_options(ensure PRIVATE "/Zc:__cplusplus")
|
||||
else()
|
||||
target_compile_options(ensure PRIVATE "-Wall" "-Wextra" "-pedantic")
|
||||
endif()
|
||||
|
||||
@ -60,7 +60,7 @@ namespace rexy::cx{
|
||||
|
||||
public:
|
||||
static constexpr size_type max_size = N;
|
||||
static constexpr size_type npos = size_type{-1};
|
||||
static constexpr size_type npos = size_type(-1);
|
||||
|
||||
public:
|
||||
value_type m_data[N] = {};
|
||||
|
||||
@ -16,6 +16,11 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef _MSC_VER
|
||||
//Disable warning from msvc for not using fopen_s
|
||||
//which is not standard in c++ as of c++23, though it is in c since c11.
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
#include "rexy/filerd.hpp"
|
||||
|
||||
#include <cstdio> //fopen, fclose
|
||||
|
||||
@ -6,7 +6,7 @@ include_directories("${INCLUDE_PATH}")
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options("/Zc:__cplusplus" "/Wall")
|
||||
add_compile_options("/Zc:__cplusplus")
|
||||
else()
|
||||
add_compile_options("-Wall" "-Wextra" "-pedantic")
|
||||
endif()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user