Opened 9 years ago

Closed 5 years ago

#9152 closed Bugs (wontfix)

Classic Spirit parser does not handle negative exponents when patform does not support denormalized numbers.

Reported by: Matthew Markland <markland@…> Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc: markland@…

Description

A classic Spirit parser has trouble parsing floating point values which have a negative exponent on platforms where has_denorm is false. The initial example from the Spirit documentation illustrates the problem (note, this is the example from the 1.8.5 documentation, tweaked for 1.54).

markland@jute geir2 $ CC -I/cray/css/users/markland/boost_1_54_0 classic_numbers.cpp
markland@jute geir2 $ ./a.out
/////////////////////////////////////////////////////////

                A comma separated list parser for Spirit...

/////////////////////////////////////////////////////////

Give me a comma separated list of numbers.
The numbers will be inserted in a vector of numbers
Type [q or Q] to quit

1.5
-------------------------
Parsing succeeded
1.5 Parses OK:
0: 1.5
-------------------------
1e-07
-------------------------
Parsing failed
-------------------------
Bye... :-)

This looks to be an issue in the negative_accumulate::add() function found in boost/spirit/home/classic/core/primitives/impl/numerics.ipp.

The platform I have seen this fail on is using the Cray Compiling Environment version 8.x. I do not currently have a patch or a workaround.

The Qi parser example appears to work for this example, even on the Cray platform.

Attachments (1)

classic_numbers.cpp (2.7 KB ) - added by Matthew Markland <markland@…> 9 years ago.
The classic numbers parser from the Spirit documentation.

Download all attachments as: .zip

Change History (4)

by Matthew Markland <markland@…>, 9 years ago

Attachment: classic_numbers.cpp added

The classic numbers parser from the Spirit documentation.

comment:1 by Matthew Markland <markland@…>, 9 years ago

Cc: markland@… added

comment:2 by Nikita Kniazev <nok.raven@…>, 5 years ago

I am sorry, Spirit.Classic is deprecated. If you have a patch, please open a pull request, otherwise this will not be fixed.

comment:3 by Joel de Guzman, 5 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.