id summary reporter owner description type status milestone component version severity resolution keywords cc 6852 lexical_cast: warning: ISO C++ does not support the ‘%lg’ gnu_printf format peter@… Antony Polukhin "The following code produces a warning if compiled with GCC (4.7.0) and -Wall -std=c++98 -pedantic: {{{ include int main() { boost::lexical_cast(double(4.2)); return 0; } }}} {{{ boost_1_49_0/include/boost/lexical_cast.hpp:1297:17: warning: ISO C++ does not support the ‘%lg’ gnu_printf format [-Wformat] }}} With regard to the length modifier, the printf(3) man page (RHEL 6.2) states: {{{ l (ell) A following integer conversion corresponds to a long int or unsigned long int argument, or a following n conversion cor- responds to a pointer to a long int argument, or a following c conversion corresponds to a wint_t argument, or a following s conversion corresponds to a pointer to wchar_t argument. }}} With regard to the conversion specifier: {{{ g, G The double argument is converted in style f or e (or F or E for G conversions). The precision specifies the number of signifi- cant digits. If the precision is missing, 6 digits are given; if the precision is zero, it is treated as 1. Style e is used if the exponent from its conversion is less than -4 or greater than or equal to the precision. Trailing zeros are removed from the fractional part of the result; a decimal point appears only if it is followed by at least one digit. }}} So the correct printf format for double is ""%g"". (Maybe this is different on non-GNU systems?)" Bugs closed To Be Determined lexical_cast Boost 1.49.0 Cosmetic fixed