boostorg / serialization

Boost.org serialization module
http://boost.org/libs/serialization
119 stars 139 forks source link

Compilation errors with gcc 4.9 through 7 due to unknown `no_sanitize` attribute #291

Closed Lastique closed 10 months ago

Lastique commented 1 year ago

Gcc from 4.9 to 7, inclusively, fail to compile code using Boost.Serialization because of the unsupported no_sanitize attribute used in boost/archive/detail/common_oarchive.hpp. This has manifested as Boost.Core CI failures like this:

In file included from ./boost/archive/detail/common_oarchive.hpp:22:0,
                 from ./boost/archive/basic_xml_oarchive.hpp:22,
                 from ./boost/archive/xml_oarchive.hpp:31,
                 from libs/core/test/serialization_nvp_test.cpp:24:
./boost/archive/detail/interface_oarchive.hpp:54:20: error: 'no_sanitize' attribute directive ignored [-Werror=attributes]
     Archive * This(){
                    ^
cc1plus: all warnings being treated as errors

    "g++-4.9"   -std=c++03 -fvisibility-inlines-hidden -fPIC -m32 -pthread -O0 -fno-inline -Wall -Wextra -Werror -g -fvisibility=hidden -march=i686  -DBOOST_ALL_NO_LIB=1   -I"."  -c -o "bin.v2/libs/core/test/serialization_nvp_test.test/gcc-4.9/debug/address-model-32/cxxstd-03-iso/threading-multi/visibility-hidden/serialization_nvp_test.o" "libs/core/test/serialization_nvp_test.cpp"

This regression was introduced by be9421f80ff5e8dedaf9bdf0c6b84a7aad3d10b6. CC @mborland.

Lastique commented 1 year ago

BTW, the clang check in the referenced commit should probably be replaced with __has_attribute.

pdimov commented 1 year ago

https://github.com/boostorg/serialization/pull/292 should be the better fix, although I see CI failures there.

pdimov commented 1 year ago

Oh, those are because of C++03.

robertramey commented 10 months ago

can I close this now?

pdimov commented 10 months ago

I think so, yes.