-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add more compilers to CI and increase FMT_PEDANTIC warning levels #736
Changes from 13 commits
22e42a6
97e1271
5d7103a
b49acb3
710d078
58991c7
ed839c4
a8976bd
194616e
584a99c
01fe59d
8d27036
16533b2
6ba5f70
739af47
25f9b09
d1976cf
d79b096
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
support/appveyor.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is necessary. |
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__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please bring There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's also used in format.h before the inclusion of core.h, but sure. |
||
#else | ||
|
@@ -42,12 +48,6 @@ | |
# define FMT_HAS_GXX_CXX11 0 | ||
#endif | ||
|
||
#ifdef _MSC_VER | ||
# define FMT_MSC_VER _MSC_VER | ||
#else | ||
# define FMT_MSC_VER 0 | ||
#endif | ||
|
||
// Check if relaxed c++14 constexpr is supported. | ||
// GCC doesn't allow throw in constexpr until version 6 (bug 67371). | ||
#ifndef FMT_USE_CONSTEXPR | ||
|
@@ -95,6 +95,12 @@ | |
# define FMT_USE_NULLPTR 0 | ||
#endif | ||
|
||
#if FMT_HAS_CPP_ATTRIBUTE(noreturn) | ||
# 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 +224,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 +556,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 +580,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 +595,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 +606,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*) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use
CXX
instead ofCXX_COMPILER
and simplifybefore_script
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Travis exports
CXX
asg++
in between ofmatrix
andbefore_script
, so the value set inmatrix
would be lost.