Re: Qi int_parser rejecting a negative signed std::intmax_t

Michael Powell <[email protected]> Mon, 12 Nov 2018 11:29:00 -0500
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <CAMEoF_EGGx2vAovXoqdR_EuKray9UL-EwSk28Ccgcf8jWPM1MA@mail.gmail.com>
On Mon, Nov 12, 2018 at 11:17 AM Michael Powell <[email protected]> wrote:
>
> On Mon, Nov 12, 2018 at 10:34 AM Michael Powell <[email protected]> wrote:
> >
> > Hello,
> >
> > qi::int_parser works fine for a positive signed hex radix integer, but
> > is failing for a negative signed hex radix integer.
>
> I've got some sample code, it builds, but I am receiving a seg fault.

Oops, my mistake. Error in one of the rules. Fixed and demonstrating
that negative values do seem to parse correctly.

http://coliru.stacked-crooked.com/a/370b6aa5c167434b

> > My integer type is std::intmax_t, which on this platform I think is long long.
> >
> > Is there an integer width constraint? And/or a signage problem?
> >
> > Do I need to enable BOOST_HAS_LONG_LONG? Or is that enabled by default?
> >
> > Cheers, thanks!
> >
> > Michael Powell