Opened 9 years ago

Closed 9 years ago

#9007 closed Bugs (fixed)

Spirt Int parser fails to detect overflow when using gcc 4.8

Reported by: cmoore@… Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

Attached test program that tries to parse a string containing INT_MAX+1.

Expected the parser to fail. When compiled with gcc 4.8, instead it succeeds and returns MIN_INT.

When compiled with gcc 4.7, 4,2 or clang 3.3, it behaves as expected.

Sample output:

$ ./Main.gcc48
sizeof(int): 4
Parsing '2147483647':
  parse success 2147483647
Parsing '2147483648':
  parse success -2147483648


$ ./Main.gcc47
sizeof(int): 4
Parsing '2147483647':
  parse success 2147483647
Parsing '2147483648':
  parse failed

Attachments (1)

ticket-9007-testcase.cpp (658 bytes ) - added by cmoore@… 9 years ago.
test-case

Download all attachments as: .zip

Change History (2)

by cmoore@…, 9 years ago

Attachment: ticket-9007-testcase.cpp added

test-case

comment:1 by Joel de Guzman, 9 years ago

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