
Hi, the following code does not compile with gcc 4.6.1: #include <boost/fusion/view.hpp> int main( int argc , char ** argv ) { return 0; } It produces errors like this: $> g++-4.6 -I$BOOST_ROOT test_fusion_view.cpp ... ... In file included from /home/karsten/boost/boost_1_47_0/boost/preprocessor/iteration/detail/iter/forward1.hpp:92:0, from /home/karsten/boost/boost_1_47_0/boost/fusion/view/nview/detail/nview_impl.hpp:40, from /home/karsten/boost/boost_1_47_0/boost/fusion/view/nview/nview.hpp:105, from /home/karsten/boost/boost_1_47_0/boost/fusion/view/nview.hpp:12, from /home/karsten/boost/boost_1_47_0/boost/fusion/view.hpp:13, from test_fusion_view.cpp:1: /home/karsten/boost/boost_1_47_0/boost/fusion/view/nview/detail/nview_impl.hpp:55:57: warning: overflow in implicit constant conversion [-Woverflow] /home/karsten/boost/boost_1_47_0/boost/fusion/view/nview/detail/nview_impl.hpp:55:57: error: overflow in constant expression [-fpermissive] /home/karsten/boost/boost_1_47_0/boost/fusion/view/nview/detail/nview_impl.hpp:55:57: note: in template argument for type ‘int’ Any Ideas? I think the code should compile sincde fusion/view.hpp is a forwarding for the views...

On 11/20/2011 8:51 AM, Karsten Ahnert wrote:
Hi,
the following code does not compile with gcc 4.6.1:
#include <boost/fusion/view.hpp>
int main( int argc , char ** argv ) { return 0; }
It produces errors like this:
[...]
Any Ideas? I think the code should compile sincde fusion/view.hpp is a forwarding for the views...
Compiles fine with VC10 and g++4.5.2. I have no idea. Unfortunately, I don't have access to 4.6.1 right now, but I'll see what I can do. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com

Hi,
the following code does not compile with gcc 4.6.1:
#include <boost/fusion/view.hpp>
int main( int argc , char ** argv ) { return 0; }
It produces errors like this:
[...]
Any Ideas? I think the code should compile sincde fusion/view.hpp is a forwarding for the views...
Compiles fine with VC10 and g++4.5.2. I have no idea. Unfortunately, I don't have access to 4.6.1 right now, but I'll see what I can do.
I have 4.6.1 and it compiles fine with that too. Regards, Nate

Nathan Ridge wrote:
Hi,
the following code does not compile with gcc 4.6.1:
#include <boost/fusion/view.hpp>
int main( int argc , char ** argv ) { return 0; }
It produces errors like this:
[...]
Any Ideas? I think the code should compile sincde fusion/view.hpp is a forwarding for the views...
Simply changing LONG_MAX to INT_MAX in line 30 of boost/fusion/view/nview/detail/nview_impl.hpp fixes the problem.
Compiles fine with VC10 and g++4.5.2. I have no idea. Unfortunately, I don't have access to 4.6.1 right now, but I'll see what I can do.
I have 4.6.1 and it compiles fine with that too.
I guess that this problem only appears in the system with sizeof(int) != sizeof(long). Regards, Michel

On 11/20/2011 10:52 AM, Michel Morin wrote:
Nathan Ridge wrote:
Hi,
the following code does not compile with gcc 4.6.1:
#include <boost/fusion/view.hpp>
int main( int argc , char ** argv ) { return 0; }
It produces errors like this:
[...]
Any Ideas? I think the code should compile sincde fusion/view.hpp is a forwarding for the views...
Simply changing LONG_MAX to INT_MAX in line 30 of boost/fusion/view/nview/detail/nview_impl.hpp fixes the problem.
Compiles fine with VC10 and g++4.5.2. I have no idea. Unfortunately, I don't have access to 4.6.1 right now, but I'll see what I can do.
I have 4.6.1 and it compiles fine with that too.
I guess that this problem only appears in the system with sizeof(int) != sizeof(long).
Thank you, all. Committed the fix. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com

On 11/20/2011 11:59 AM, Joel de Guzman wrote:
On 11/20/2011 10:52 AM, Michel Morin wrote:
Nathan Ridge wrote:
Hi,
the following code does not compile with gcc 4.6.1:
#include <boost/fusion/view.hpp>
int main( int argc , char ** argv ) { return 0; }
It produces errors like this:
[...]
Any Ideas? I think the code should compile sincde fusion/view.hpp is a forwarding for the views...
Simply changing LONG_MAX to INT_MAX in line 30 of boost/fusion/view/nview/detail/nview_impl.hpp fixes the problem.
Compiles fine with VC10 and g++4.5.2. I have no idea. Unfortunately, I don't have access to 4.6.1 right now, but I'll see what I can do.
I have 4.6.1 and it compiles fine with that too.
I guess that this problem only appears in the system with sizeof(int) != sizeof(long).
Thank you, all. Committed the fix.
Regards,
Everything works fine now. Thanks.

the following code does not compile with gcc 4.6.1:
#include <boost/fusion/view.hpp>
int main( int argc , char ** argv ) { return 0; }
It produces errors like this:
[snip]
/home/karsten/boost/boost_1_47_0/boost/fusion/view/nview/detail/nview_impl.hpp:55:57: error: overflow in constant expression [-fpermissive] /home/karsten/boost/boost_1_47_0/boost/fusion/view/nview/detail/nview_impl.hpp:55:57: note: in template argument for type ‘int’
I think I know what the problem is! The problem is that this line in fusion/view/nview/detail/nview_impl.hpp: , BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(FUSION_MAX_VECTOR_SIZE, int I, LONG_MAX)> expands to code like , int I0 = 2147483647L , int I1 = 2147483647L , int I2 = 2147483647L , int I3 = 2147483647L , int I4 = 2147483647L , int I5 = 2147483647L , int I6 = 2147483647L , int I7 = 2147483647L , int I8 = 2147483647L , int I9 = 2147483647L > Note that that's an "int I", but a "LONG_MAX". The OP must be using a system where int and long have different sizes, and so LONG_MAX is too large on an integer to be used as a default parameter for an int template argument. Joel and I don't see the issue because on our systems, int and long has the same size. The solution, then, would be to replace LONG_MAX with INT_MAX on that line. Regards, Nate
participants (4)
-
Joel de Guzman
-
Karsten Ahnert
-
Michel Morin
-
Nathan Ridge