Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#8941 closed Bugs (duplicate)

Detection of availability of 128-bit integers should be left on Boost.Config

Reported by: Petr Machata <pmachata@…> Owned by: Antony Polukhin
Milestone: Component: lexical_cast
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

The following code in lexical_cast.hpp appears wrong:

#if (defined(BOOST_LCAST_HAS_INT128) && !defined(__GNUC__)) || GCC_VERSION > 40700
#define BOOST_LCAST_HAS_INT128
#endif

I'm uncertain whether BOOST_LCAST_HAS_INT128 serves some purpose such as per-library configuration. It seems to me it would be best to simply defer this logic to config.hpp, drop this piece of code, and later on dispatch on BOOST_HAS_INT128. I'm attaching a patch to this effect.

Note that this logic currently breaks on i386, where GCC doesn't support 128-bit data types even though it otherwise satisfies the above condition.

If you wish to have this configured specifically for lexical cast, I can work in some logic that overrides BOOST_HAS_INT128 in favor of whatever BOOST_LCAST_HAS_INT128 setting came from the "outside" (if any).

Attachments (1)

boost-1.54.0-lexical_cast-int128.patch (2.1 KB ) - added by Petr Machata <pmachata@…> 9 years ago.
A fix.

Download all attachments as: .zip

Change History (4)

by Petr Machata <pmachata@…>, 9 years ago

A fix.

comment:1 by Petr Machata <pmachata@…>, 9 years ago

Oops, and I see there's a duplicate of this bug already: #8790.

comment:2 by Antony Polukhin, 9 years ago

Milestone: To Be DeterminedBoost 1.56.0
Resolution: duplicate
Status: newclosed

comment:3 by Antony Polukhin, 9 years ago

Milestone: Boost 1.56.0
Note: See TracTickets for help on using tickets.