-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more compilers to CI and increase FMT_PEDANTIC warning levels (#736)
* Add a _lot_ more warnings to FMT_PEDANTIC Fix these warnings * Add more compilers to CI Fix (some) of the compiler errors with them * Enable -Werror on CI Increase warning level on MSVC when compiling with FMT_PEDANTIC * Add VS 2013 and 2015 to Appveyor * Fix Appveyor tests Formatting * Implement requested changes Fix some of the MSVC warnings Implement C++11 integer_sequence * Reintroduce appveyor-build.py * Remove ranges-test from tests * Remove (some) explicit warning suppressions Fix C++ standard setting in CI * Remove (some) explicit warning suppressions Fix C++ standard setting in CI * Fix test builds with C++11 * Enable pedantic warnings on tests * Fix warnings from edits to master * Cleanups * Add C++11 support to ranges.h Re-enable ranges-test Fix a Visual Studio error about function not returning a value in printf.h Fix a bug in .travis.yml
- Loading branch information
1 parent
dd1a5ef
commit 691a7a9
Showing
36 changed files
with
586 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,94 @@ | ||
language: cpp | ||
dist: trusty | ||
sudo: required # the doc target uses sudo to install dependencies | ||
sudo: false | ||
|
||
os: linux | ||
|
||
git: | ||
depth: 1 | ||
|
||
os: | ||
- linux | ||
- osx | ||
|
||
env: | ||
global: | ||
- secure: |- | ||
a1eovNn4uol9won7ghr67eD3/59oeESN+G9bWE+ecI1V6yRseG9whniGhIpC/YfMW/Qz5I | ||
5sxSmFjaw9bxCISNwUIrL1O5x2AmRYTnFcXk4dFsUvlZg+WeF/aKyBYCNRM8C2ndbBmtAO | ||
o1F2EwFbiso0EmtzhAPs19ujiVxkLn4= | ||
matrix: | ||
- BUILD=Doc | ||
- BUILD=Debug STANDARD=14 | ||
- BUILD=Release STANDARD=14 | ||
matrix: | ||
exclude: | ||
- os: osx | ||
env: BUILD=Doc | ||
include: | ||
# Documentation | ||
- env: BUILD=Doc | ||
sudo: required | ||
# g++ 6 on Linux with C++14 | ||
- env: COMPILER=g++-6 BUILD=Debug STANDARD=14 | ||
compiler: gcc | ||
addons: | ||
apt: | ||
update: true | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-6 | ||
- env: COMPILER=g++-6 BUILD=Release STANDARD=14 | ||
compiler: gcc | ||
addons: | ||
apt: | ||
update: true | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-6 | ||
# Apple clang on OS X with C++14 | ||
- env: BUILD=Debug STANDARD=14 | ||
compiler: clang | ||
os: osx | ||
- env: BUILD=Release STANDARD=14 | ||
compiler: clang | ||
os: osx | ||
# clang 6.0 on Linux with C++14 | ||
- env: COMPILER=clang++-6.0 BUILD=Debug STANDARD=14 | ||
compiler: clang | ||
addons: | ||
apt: | ||
update: true | ||
packages: | ||
- clang-6.0 | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- llvm-toolchain-trusty | ||
- llvm-toolchain-trusty-6.0 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
eliaskosunen
Author
Contributor
|
||
# clang 4.0 on Linux with C++14 | ||
- env: COMPILER=clang++-4.0 BUILD=Debug STANDARD=11 | ||
compiler: clang | ||
addons: | ||
apt: | ||
update: true | ||
packages: | ||
- clang-4.0 | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
- llvm-toolchain-trusty | ||
- llvm-toolchain-trusty-4.0 | ||
# g++ 4.8 on Linux with C++11 | ||
- env: COMPILER=g++-4.8 BUILD=Debug STANDARD=11 | ||
compiler: gcc | ||
# g++ 4.4 on Linux with C++11 | ||
- env: COMPILER=g++-4.4 BUILD=Debug STANDARD=11 | ||
compiler: gcc | ||
addons: | ||
apt: | ||
update: true | ||
packages: | ||
- g++-4.4 | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
# Android | ||
- language: android | ||
android: | ||
addons: | ||
apt: | ||
update: true | ||
components: | ||
- tools | ||
- platform-tools | ||
|
@@ -51,17 +116,14 @@ matrix: | |
after_success: | ||
- cd ${TRAVIS_BUILD_DIR} | ||
- tree ./libs | ||
allow_failures: | ||
# Errors | ||
- env: COMPILER=g++-4.4 BUILD=Debug STANDARD=11 | ||
compiler: gcc | ||
|
||
# Install gcc-6 for extended constexpr support. | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-6 | ||
|
||
before_install: | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX=g++-6; fi | ||
before_script: | ||
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then export CXX=${COMPILER}; fi | ||
- if [[ "${BUILD}" != "Doc" ]]; then ${CXX} --version; fi | ||
|
||
script: | ||
- support/travis-build.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,12 @@ | |
# define FMT_HAS_INCLUDE(x) 0 | ||
#endif | ||
|
||
#ifdef __has_cpp_attribute | ||
# define FMT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) | ||
#else | ||
# define FMT_HAS_CPP_ATTRIBUTE(x) 0 | ||
#endif | ||
|
||
#if defined(__GNUC__) && !defined(__clang__) | ||
# define FMT_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) | ||
#else | ||
|
@@ -95,6 +101,12 @@ | |
# define FMT_USE_NULLPTR 0 | ||
#endif | ||
|
||
#if FMT_HAS_CPP_ATTRIBUTE(noreturn) | ||
This comment has been minimized.
Sorry, something went wrong.
Remotion
Contributor
|
||
# define FMT_NORETURN [[noreturn]] | ||
#else | ||
# define FMT_NORETURN /*noreturn*/ | ||
#endif | ||
|
||
// Check if exceptions are disabled. | ||
#if defined(__GNUC__) && !defined(__EXCEPTIONS) | ||
# define FMT_EXCEPTIONS 0 | ||
|
@@ -218,7 +230,7 @@ class basic_string_view { | |
#else | ||
struct type { | ||
const char *data() const { return FMT_NULL; } | ||
size_t size() const { return 0; }; | ||
size_t size() const { return 0; } | ||
}; | ||
#endif | ||
|
||
|
@@ -550,11 +562,17 @@ FMT_CONSTEXPR basic_format_arg<Context> make_arg(const T &value); | |
return static_cast<ValueType>(val); \ | ||
} | ||
|
||
#define FMT_MAKE_VALUE_SAME(TAG, Type) \ | ||
template <typename C> \ | ||
FMT_CONSTEXPR typed_value<C, TAG> make_value(Type val) { \ | ||
return val; \ | ||
} | ||
|
||
FMT_MAKE_VALUE(bool_type, bool, int) | ||
FMT_MAKE_VALUE(int_type, short, int) | ||
FMT_MAKE_VALUE(uint_type, unsigned short, unsigned) | ||
FMT_MAKE_VALUE(int_type, int, int) | ||
FMT_MAKE_VALUE(uint_type, unsigned, unsigned) | ||
FMT_MAKE_VALUE_SAME(int_type, int) | ||
FMT_MAKE_VALUE_SAME(uint_type, unsigned) | ||
|
||
// To minimize the number of types we need to deal with, long is translated | ||
// either to int or to long long depending on its size. | ||
|
@@ -568,8 +586,8 @@ FMT_MAKE_VALUE( | |
(sizeof(unsigned long) == sizeof(unsigned) ? uint_type : ulong_long_type), | ||
unsigned long, ulong_type) | ||
|
||
FMT_MAKE_VALUE(long_long_type, long long, long long) | ||
FMT_MAKE_VALUE(ulong_long_type, unsigned long long, unsigned long long) | ||
FMT_MAKE_VALUE_SAME(long_long_type, long long) | ||
FMT_MAKE_VALUE_SAME(ulong_long_type, unsigned long long) | ||
FMT_MAKE_VALUE(int_type, signed char, int) | ||
FMT_MAKE_VALUE(uint_type, unsigned char, unsigned) | ||
FMT_MAKE_VALUE(char_type, char, int) | ||
|
@@ -583,8 +601,8 @@ inline typed_value<C, char_type> make_value(wchar_t val) { | |
#endif | ||
|
||
FMT_MAKE_VALUE(double_type, float, double) | ||
FMT_MAKE_VALUE(double_type, double, double) | ||
FMT_MAKE_VALUE(long_double_type, long double, long double) | ||
FMT_MAKE_VALUE_SAME(double_type, double) | ||
FMT_MAKE_VALUE_SAME(long_double_type, long double) | ||
|
||
// Formatting of wide strings into a narrow buffer and multibyte strings | ||
// into a wide buffer is disallowed (https://github.com/fmtlib/fmt/pull/606). | ||
|
@@ -594,18 +612,17 @@ FMT_MAKE_VALUE(cstring_type, const typename C::char_type*, | |
const typename C::char_type*) | ||
|
||
FMT_MAKE_VALUE(cstring_type, signed char*, const signed char*) | ||
FMT_MAKE_VALUE(cstring_type, const signed char*, const signed char*) | ||
FMT_MAKE_VALUE_SAME(cstring_type, const signed char*) | ||
FMT_MAKE_VALUE(cstring_type, unsigned char*, const unsigned char*) | ||
FMT_MAKE_VALUE(cstring_type, const unsigned char*, const unsigned char*) | ||
FMT_MAKE_VALUE(string_type, basic_string_view<typename C::char_type>, | ||
basic_string_view<typename C::char_type>) | ||
FMT_MAKE_VALUE_SAME(cstring_type, const unsigned char*) | ||
FMT_MAKE_VALUE_SAME(string_type, basic_string_view<typename C::char_type>) | ||
FMT_MAKE_VALUE(string_type, | ||
typename basic_string_view<typename C::char_type>::type, | ||
basic_string_view<typename C::char_type>) | ||
FMT_MAKE_VALUE(string_type, const std::basic_string<typename C::char_type>&, | ||
basic_string_view<typename C::char_type>) | ||
FMT_MAKE_VALUE(pointer_type, void*, const void*) | ||
FMT_MAKE_VALUE(pointer_type, const void*, const void*) | ||
FMT_MAKE_VALUE_SAME(pointer_type, const void*) | ||
|
||
#if FMT_USE_NULLPTR | ||
FMT_MAKE_VALUE(pointer_type, std::nullptr_t, const void*) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
@eliaskosunen, do we need both
llvm-toolchain-trusty
andllvm-toolchain-trusty-6.0
?