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: | 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)
Change History (4)
by , 9 years ago
| Attachment: | classic_numbers.cpp added |
|---|
comment:1 by , 9 years ago
| Cc: | added |
|---|
comment:2 by , 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 , 5 years ago
| Resolution: | → wontfix |
|---|---|
| Status: | new → closed |

The classic numbers parser from the Spirit documentation.