Re: [Boost-bugs] [Boost C++ Libraries] #4658: (boost::format("%u") % (unsigned char)2).str(); error result

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4658: (boost::format("%u") % (unsigned char)2).str(); error result
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-10-18 13:12:54

#4658: (boost::format("%u") % (unsigned char)2).str(); error result
  Reporter: anonymous | Owner: James E. King, III
      Type: Bugs | Status: closed
 Milestone: | Component: format
   Version: Boost 1.44.0 | Severity: Problem
Resolution: wontfix | Keywords:
Changes (by James E. King, III):

 * status: assigned => closed
 * resolution: => wontfix
 * milestone: Boost 1.44.0 =>


 Resolving this as wontfix because it is working as designed. The argument
 type modifiers are ignored completely by Boost.Format for type safety
 reasons as defined in the documentation for the library.

 A workaround is to cast the value to an integer before adding it with
 operator %.

 I'm thinking about changing this behavior in future releases, and allowing
 full ISO C99 compatibility, possibly by simply leveraging snprintf when a
 C style format specification with a conversion specifier is used.
 Anything that happens in this area would be fully backwards compatible
 through preprocessor macros. We'll see.

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-10-18 13:19:20 UTC