Boost logo

Boost :

Subject: Re: [boost] [exception] [type_traits] [move] warning: unrecognized #pragma GCC system_header
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2012-07-05 12:09:19


2012/7/5 Krzysztof Czainski <1czajnik_at_[hidden]>

> Hello,
>
> Below is a list of files, that contain:
> #if defined(__GNUC__)
> #pragma GCC system_header
> #endif
> which causes a warning on my TI compiler.
>
> E:\boost\include\boost-1_50_0\boost\exception\all.hpp
> E:\boost\include\boost-1_50_0\boost\exception\current_exception_cast.hpp
> E:\boost\include\boost-1_50_0\boost\exception\detail\error_info_impl.hpp
> E:\boost\include\boost-1_50_0\boost\exception\detail\exception_ptr.hpp
>
> E:\boost\include\boost-1_50_0\boost\exception\detail\is_output_streamable.hpp
> E:\boost\include\boost-1_50_0\boost\exception\detail\object_hex_dump.hpp
> E:\boost\include\boost-1_50_0\boost\exception\detail\type_info.hpp
> E:\boost\include\boost-1_50_0\boost\exception\diagnostic_information.hpp
> E:\boost\include\boost-1_50_0\boost\exception\errinfo_errno.hpp
> E:\boost\include\boost-1_50_0\boost\exception\exception.hpp
> E:\boost\include\boost-1_50_0\boost\exception\get_error_info.hpp
> E:\boost\include\boost-1_50_0\boost\exception\info.hpp
> E:\boost\include\boost-1_50_0\boost\exception\info_tuple.hpp
> E:\boost\include\boost-1_50_0\boost\exception\to_string.hpp
> E:\boost\include\boost-1_50_0\boost\exception\to_string_stub.hpp
> E:\boost\include\boost-1_50_0\boost\throw_exception.hpp
> E:\boost\include\boost-1_50_0\boost\type_traits\is_virtual_base_of.hpp
>
> In other files, i.e. boost\integer.hpp, I've found this #pragma guarded
> against __GNUC__ >= 4:
> #if defined(__GNUC__) && (__GNUC__ >= 4)
> #pragma GCC system_header
> #endif
> which doesn't cause a warning on my compiler, because it defines __GNUC__
> to 3.
>
> Could this be fixed in the files on the list above, or are there some
> __GNUC__ 3 compilers, that need this pragma to be enabled?
>
> Regards,
> Kris
>

Similar question for boost/move.hpp and __attribute__((__may_alias__)) -
would the following change be welcome?

{{{
Index: move.hpp
===================================================================
--- move.hpp (revision 0)
+++ move.hpp (revision 1)
@@ -217,7 +217,7 @@
 #if defined(BOOST_NO_RVALUE_REFERENCES) &&
!defined(BOOST_MOVE_DOXYGEN_INVOKED)

    //Move emulation rv breaks standard aliasing rules so add workarounds
for some compilers
- #ifdef __GNUC__
+ #if defined(__GNUC__) && (__GNUC__ >= 4)
       #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
    #else
       #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS
}}}

Regards,
Kris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk