Infinite loop on x86_64 platform with 64bit target
I am using Spirit (jeez you'd propably never guessed that ..) however my
g++ is ending up in an infinite loop when I try to compile for a 64bit
target. If a compile the same file for a 32bit target on the same
machine, all's well.
It may be because of the construct I have used. I've added some stuff to
enable parsing a comma separated list of numbers and/or ranges, where a
'range' is <number>-<number> (to emphasize that 'range' in this context
is not range as in the predefined 'range_p' parser).
I'm compiling with g++-3.3.2 on an Opteron running a 64bit Linux 2.4.25
kernel. More detail info is in the attached 'infinite-loop.txt' file
(output of uname en g++ -v amongst others).
Anyone else having seen this before? Googling turned up nothing, nor did
searching the mail-archive - unless I haven't searched carefully enough.
Maybe I should use a different approach? I havent' come up with an
alternative yet. I'm open to suggestions!
Any help would be greatly appreciated - I prefer not to run 32bit code
on my 64bit machine - no use in not using half the CPU :/ ;)
I include the source of the file I'm trying to compile below.
using namespace std;
using namespace boost::spirit;
// The grammar for a list
// of ints and ranges of ints
template <typename ScannerT>
rule<ScannerT> line, range, entry;
definition( ilist_grammar const& self )
// if a 'range' is parsed,
// it sets the range start, range end
// and finally insert [start,end) into
// the list
range = (int_p[assign(self.r_start)] >> '-'
// if the int_p is parsed, the integer
// is automagically appended to the list
entry = range|int_p[append(self.iList)];
line = entry >> *(',' >> entry);
// we don't actually use the iterators (in this case)
// this is supposed to be triggered when a range is
// parsed and this will append the range to the
// result and clear the range for the next range
template <typename IteratorT>
void operator()( IteratorT , IteratorT ) const
if( parent )
while( parent->r_start<=parent->r_end )
parent->r_start = 0;
parent->r_end = 0;
parent( 0 )
ranger_t( ilist_grammar* p ) :
parent( p )
mutable int r_start, r_end;
// this functor is used to be able to process a parsed range
// the void operator()( iterator start, iterator end ) const
// is called - this method will process the range
mutable ranger_t ranger;
mutable vector<int> iList;
ranger( this )
// this parses a list of integers and ranges of integers
// into a vector.
// The vector is uniquefied and sorted
// before it's given back to the user
bool parse_list( const char* s, vector<int>& v )
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________
Spirit-general mailing list
[hidden email] https://lists.sourceforge.net/lists/listinfo/spirit-general