From dcfe9f219256aef3f514c9c6ef1a4ef3d12d9724 Mon Sep 17 00:00:00 2001 From: seleznevae Date: Sun, 19 May 2019 19:54:26 +0300 Subject: [PATCH] [D] Deleted standard versions from cmake --- .cirrus.yml | 6 +++--- .travis.yml | 8 ++++---- CMakeLists.txt | 8 ++++---- lib/fort.h | 5 +++++ src/fort.h | 5 +++++ 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 9761f6a..fff3a98 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -27,7 +27,7 @@ main_task: # Test build without optimizations and with asan - mkdir -p build - cd build - - cmake .. -DFORT_BUILD_TYPE=asan -DCMAKE_BUILD_TYPE=Debug + - cmake .. -DFORT_BUILD_TYPE=asan -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_STANDARD=99 -DCMAKE_CXX_STANDARD=11 - cmake --build . --target all - ls - ctest -VV @@ -37,7 +37,7 @@ main_task: # Test build without optimizations and with ubsan - mkdir -p build - cd build - - cmake .. -DFORT_BUILD_TYPE=ubsan -DCMAKE_BUILD_TYPE=Debug + - cmake .. -DFORT_BUILD_TYPE=ubsan -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_STANDARD=99 -DCMAKE_CXX_STANDARD=11 - cmake --build . --target all - ls - ctest -VV @@ -47,7 +47,7 @@ main_task: # Test without WCHAR support - mkdir -p build - cd build - - cmake .. -DFORT_ENABLE_WCHAR=OFF -DCMAKE_BUILD_TYPE=Debug + - cmake .. -DFORT_ENABLE_WCHAR=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_STANDARD=99 -DCMAKE_CXX_STANDARD=11 - cmake --build . --target all - ls - ctest -VV diff --git a/.travis.yml b/.travis.yml index d16c196..6ef2ac1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -191,7 +191,7 @@ script: # Test build without optimizations and with asan - mkdir -p build - cd build - - cmake .. -DFORT_BUILD_TYPE=asan -DCMAKE_BUILD_TYPE=Debug + - cmake .. -DFORT_BUILD_TYPE=asan -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_STANDARD=99 -DCMAKE_CXX_STANDARD=11 - cmake --build . --target all - ls - ctest -VV @@ -201,7 +201,7 @@ script: - rm -r build/* - mkdir -p build - cd build - - cmake .. -DFORT_ENABLE_WCHAR=OFF -DCMAKE_BUILD_TYPE=Debug + - cmake .. -DFORT_ENABLE_WCHAR=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_STANDARD=99 -DCMAKE_CXX_STANDARD=11 - cmake --build . --target all - ls - ctest -VV @@ -212,7 +212,7 @@ script: cd .. ; rm -r build/* ; cd build ; - cmake .. -DFORT_BUILD_TYPE=ubsan -DCMAKE_BUILD_TYPE=Debug ; + cmake .. -DFORT_BUILD_TYPE=ubsan -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_STANDARD=99 -DCMAKE_CXX_STANDARD=11 ; cmake --build . --target all ; ls ; ctest -VV; @@ -258,7 +258,7 @@ script: cd .. ; rm -r build/* ; cd build ; - cmake .. -DFORT_BUILD_TYPE=coveralls -DCMAKE_BUILD_TYPE=Debug ; + cmake .. -DFORT_BUILD_TYPE=coveralls -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_STANDARD=99 -DCMAKE_CXX_STANDARD=11 ; cmake --build . --target all ; ls ; ./tests/libfort_test_dev ; diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b54fbb..0c3d46f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,10 @@ message(STATUS "libfort build options: " " wchar support = ${FORT_ENABLE_WCHAR}; " " build type = ${FORT_BUILD_TYPE}") +# for fort.hpp +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + # ------------------------------------------------------------------------------ # Warnings # ------------------------------------------------------------------------------ @@ -59,12 +63,8 @@ else() -Wlogical-op") endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ADDITIONAL_WARNINGS} -Wpedantic") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_WARNINGS}") - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 ") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() # ------------------------------------------------------------------------------ diff --git a/lib/fort.h b/lib/fort.h index ce4e78a..10acb8a 100644 --- a/lib/fort.h +++ b/lib/fort.h @@ -614,6 +614,11 @@ struct ft_border_style { /** * @defgroup BasicStyles * @name Built-in table border styles. + * @note Built-in border styles (FT_BASIC_STYLE, FT_BASIC2_STYLE ...) can be + * used as arguments for @ref ft_set_border_style and + * @ref ft_set_default_border_style, but their fields shouldn't be accessed + * directly because implementation doesn't guarantee that these objects are + * properly initialized. * @{ */ extern const struct ft_border_style *const FT_BASIC_STYLE; diff --git a/src/fort.h b/src/fort.h index ce4e78a..10acb8a 100644 --- a/src/fort.h +++ b/src/fort.h @@ -614,6 +614,11 @@ struct ft_border_style { /** * @defgroup BasicStyles * @name Built-in table border styles. + * @note Built-in border styles (FT_BASIC_STYLE, FT_BASIC2_STYLE ...) can be + * used as arguments for @ref ft_set_border_style and + * @ref ft_set_default_border_style, but their fields shouldn't be accessed + * directly because implementation doesn't guarantee that these objects are + * properly initialized. * @{ */ extern const struct ft_border_style *const FT_BASIC_STYLE;