Opened 10 years ago
Closed 6 years ago
#7166 closed Bugs (fixed)
Phoenix unconditionally sets BOOST_PROTO_MAX_ARITY
Reported by: | Owned by: | Thomas Heller | |
---|---|---|---|
Milestone: | To Be Determined | Component: | phoenix |
Version: | Boost 1.50.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Hi,
The following :
#define BOOST_PROTO_MAX_ARITY 20 #include <boost/phoenix.hpp>
exhibits the following warning with msvc 2010 and boost 1.50 :
1>C:\dev\include\boost/phoenix/core/limits.hpp(19): warning C4005: 'BOOST_PROTO_MAX_ARITY' : macro redefinition
This is rather inconvenient for the user of several libraries. I suggest to modify limits.hpp to change :
#if defined(BOOST_PHOENIX_LIMIT) #define BOOST_PROTO_MAX_ARITY BOOST_PHOENIX_LIMIT
to :
#if defined(BOOST_PHOENIX_LIMIT) # if !defined( BOOST_PROTO_MAX_ARITY ) # define BOOST_PROTO_MAX_ARITY BOOST_PHOENIX_LIMIT # elif (BOOST_PROTO_MAX_ARITY < BOOST_PHOENIX_LIMIT) # error "BOOST_PROTO_MAX_ARITY is set too low" # endif
or see the attached patch.
Thanks, MAT.
Attachments (2)
Change History (6)
by , 10 years ago
Attachment: | boost_phoenix_limits.hpp.patch added |
---|
comment:1 by , 9 years ago
by , 9 years ago
Attachment: | boost_phoenix_7166.patch added |
---|
comment:2 by , 9 years ago
I forgot to mention that this solution was also suggested in this thread : http://boost.2283326.n4.nabble.com/phoenix-not-playing-nice-with-other-libs-td3489758.html
comment:4 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I added a test case to verify that the following code fails to compile
because in case BOOST_PROTO_MAX_ARITY has been previously defined (for instance by including another boost library) there isn't much that can be done but #error'ing to the user.
boost_phoenix_7166.patch includes both the test case and the fix already included in the previous patch.
Cheers,
MAT.