Boost C++ Libraries: Ticket #10852: boost format operator % won't accept dereference of volatile https://svn.boost.org/trac10/ticket/10852 <p> struct A{ </p> <blockquote> <p> A() : a(9) {} int a; </p> </blockquote> <p> }; A a; A volatile *pva = &amp;a; </p> <blockquote> <p> std::cout &lt;&lt; boost::format("%d") % pva-&gt;a &lt;&lt; std::endl; </p> </blockquote> <p> This worked in 1_54 but fails in 1_56 with error: </p> <p> format/feed_args.hpp:135:47: error: invalid conversion from 'volatile void*' to 'const void*' </p> <p> Can work around this with cast: </p> <blockquote> <p> std::cout &lt;&lt; boost::format("%d") % (int)pva-&gt;a &lt;&lt; std::endl; </p> </blockquote> <p> but should not have to. The appearance to the user is pass by value. </p> <p> Running linux with g++ 4.6.2 and 4.8.2 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10852 Trac 1.4.3 Daniel Krügler <daniel.kruegler@…> Mon, 09 Feb 2015 18:36:59 GMT <link>https://svn.boost.org/trac10/ticket/10852#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10852#comment:1</guid> <description> <p> We recently run into the very same problem: Our logger internally delegates to boost::format and users complained that they cannot logging output for volatile variables. </p> </description> <category>Ticket</category> </item> <item> <author>jim.king@…</author> <pubDate>Tue, 22 Sep 2015 13:34:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10852#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10852#comment:2</guid> <description> <p> This is present in boost 1.59 using clang-3.8 (in development) as well. It happens with any numeric type, not just int. One workaround is to use a static_cast to the same type, stripping the volatile keyword. </p> </description> <category>Ticket</category> </item> <item> <author>fgeorge@…</author> <pubDate>Mon, 13 Jun 2016 21:12:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10852#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10852#comment:3</guid> <description> <p> I ran into the same issue in boost 1.61.0 using visual studio 2008 (msvc-9.0), with a volatile size_t. static_cast&lt;size_t&gt; is the current workaround i'm using. </p> </description> <category>Ticket</category> </item> <item> <author>arnaud.richard@…</author> <pubDate>Mon, 27 Mar 2017 08:05:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10852#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10852#comment:4</guid> <description> <p> Same issue in boost 1.63.0 using Linaro GCC 5.2-2015.11-2 </p> </description> <category>Ticket</category> </item> <item> <dc:creator>James E. King, III</dc:creator> <pubDate>Thu, 12 Oct 2017 18:27:49 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/10852#comment:5 https://svn.boost.org/trac10/ticket/10852#comment:5 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Samuel Krempp</span> to <span class="trac-author">James E. King, III</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket James E. King, III Wed, 18 Oct 2017 19:21:31 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/10852#comment:6 https://svn.boost.org/trac10/ticket/10852#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">obsolete</span> </li> </ul> <p> Issue moved to github: <a class="ext-link" href="https://github.com/boostorg/format/issues/36"><span class="icon">​</span>https://github.com/boostorg/format/issues/36</a> </p> Ticket