Opened 10 years ago

Closed 10 years ago

#7095 closed Bugs (fixed)

warning: unrecognized __attribute__((__may_alias__))

Reported by: 1czajnik@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: move
Version: Boost 1.50.0 Severity: Problem
Keywords: Cc:

Description

Hello,

boost/move.hpp contains:

//Move emulation rv breaks standard aliasing rules so add workarounds for some compilers
#ifdef __GNUC__
   #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
#else
   #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS
#endif

and using __attribute__((__may_alias__)) causes a warning on my TI compiler.

Would a fix by guarding against __GNUC__>=4 be welcome, or are there some __GNUC__=3 compilers, that need this pragma to be enabled?

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

Change History (1)

comment:1 by Ion Gaztañaga, 10 years ago

Resolution: fixed
Status: newclosed

Thanks for the report fixed in trunk at revision: 79424

Note: See TracTickets for help on using tickets.