Opened 15 years ago

Closed 15 years ago

#1595 closed Bugs (fixed)

[spirit] missing #includes

Reported by: faridz@… Owned by: Joel de Guzman
Milestone: Boost 1.35.0 Component: spirit
Version: Boost Development Trunk Severity: Showstopper
Keywords: Cc: Hartmut Kaiser

Description

The stdcxx is the another implementation of the STL (initially based on RogueWave STL).

The following errors are encountered when running boost regression tests on msvc with stdcxx-4.2.0.

ast_calc_tests.cpp
..\boost/spirit/tree/impl/tree_to_xml.ipp(67) : error C3861: 'strlen': identifier not found
..\libs\spirit\test\ast_calc_tests.cpp(158) : error C3861: 'strtol': identifier not found

The proposed patch:

Index: boost/spirit/tree/impl/tree_to_xml.ipp
===================================================================
--- boost/spirit/tree/impl/tree_to_xml.ipp	(revision 42908)
+++ boost/spirit/tree/impl/tree_to_xml.ipp	(working copy)
@@ -13,6 +13,7 @@
 
 #include <cstdio>
 #include <cstdarg>
+#include <string.h>    // for strlen()
 #include <locale>
 #include <string>
 
Index: libs/spirit/test/ast_calc_tests.cpp
===================================================================
--- libs/spirit/test/ast_calc_tests.cpp	(revision 42908)
+++ libs/spirit/test/ast_calc_tests.cpp	(working copy)
@@ -13,6 +13,7 @@
 #include <boost/spirit/tree/tree_to_xml.hpp>
 #include <boost/detail/workaround.hpp>
 
+#include <stdlib.h>    // for strtol()
 #include <iostream>
 #include <stack>
 #include <functional>

Change History (2)

comment:1 by faridz@…, 15 years ago

Another errors:

numerics_tests.cpp
..\libs\spirit\test\numerics_tests.cpp(138) : error C2065: 'UINT_MAX' : undeclared identifier
..\libs\spirit\test\numerics_tests.cpp(153) : error C2065: 'INT_MAX' : undeclared identifier
..\libs\spirit\test\numerics_tests.cpp(156) : error C2065: 'INT_MIN' : undeclared identifier

The patch:

Index: libs/spirit/test/numerics_tests.cpp
===================================================================
--- libs/spirit/test/numerics_tests.cpp	(revision 42908)
+++ libs/spirit/test/numerics_tests.cpp	(working copy)
@@ -9,6 +9,7 @@
 =============================================================================*/
 #include <boost/spirit/core.hpp>
 #include <boost/spirit/actor/assign_actor.hpp>
+#include <climits>     // for INT_MIN, INT_MAX, UINT_MAX
 #include <iostream>
 #include <boost/detail/lightweight_test.hpp>

comment:2 by Hartmut Kaiser, 15 years ago

Resolution: fixed
Status: newclosed

I applied your patch to V1.35. and the trunk.

Regards Hartmut

Note: See TracTickets for help on using tickets.