vpiotr / decimal_for_cpp

Decimal data type for C++
273 stars 68 forks source link

Still C++11 stuff when DEC_NO_CPP11 is defined #50

Closed SpaceIm closed 3 years ago

SpaceIm commented 3 years ago

Example in README gives me those warnings when DEC_NO_CPP11is defined before inclusion of decimal.h (commit of version 1.18), with AppleClang 12 on Macos without forcing C++11 standard or higher:

/Users/spaceim/.conan/data/decimal_for_cpp/1.18/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/decimal.h:129:9: warning: 'static_assert' macro redefined [-Wmacro-redefined]
#define static_assert(a,b)
        ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:880:10: note: previous definition is here
# define static_assert(...) _Static_assert(__VA_ARGS__)
         ^
In file included from ../../test_package.cpp:2:
/Users/spaceim/.conan/data/decimal_for_cpp/1.18/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/decimal.h:1602:36: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
        char decimal_point() const override {
                                   ^
/Users/spaceim/.conan/data/decimal_for_cpp/1.18/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/decimal.h:1606:36: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
        char thousands_sep() const override {
                                   ^
/Users/spaceim/.conan/data/decimal_for_cpp/1.18/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/decimal.h:1610:41: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
        bool thousands_grouping() const override {
                                        ^
/Users/spaceim/.conan/data/decimal_for_cpp/1.18/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/include/decimal.h:1614:38: warning: 'override' keyword is a C++11 extension [-Wc++11-extensions]
        std::string grouping() const override {
                                     ^
vpiotr commented 3 years ago

Corrected C++98 support in https://github.com/vpiotr/decimal_for_cpp/commit/2bcf48af509690579cf2b521af46e7fb0157c8da