[Boost-bugs] [Boost C++ Libraries] #11872: "std::sprintf" it is normal?

Subject: [Boost-bugs] [Boost C++ Libraries] #11872: "std::sprintf" it is normal?
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-12-24 22:23:32


#11872: "std::sprintf" it is normal?
----------------------------------------+------------------------------
 Reporter: Pavel Vatagin <pavelvat@…> | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.61.0
 Severity: Problem | Keywords:
----------------------------------------+------------------------------
 In many places of the Boost meets this line: "std::sprintf();".
 In my case, one of these lines in the file
 boost/interprocess/detail/win32_api.hpp causes a compilation error in
 mingw:
 {{{
 In file included from
 /home/pavel/builds/mxe/usr/i686-w64-mingw32.shared/include/boost/interprocess/detail/atomic.hpp:58:0,
                  from /home/pavel/src/eiskaltdcpp/dcpp/Atomic.h:23,
                  from
 /home/pavel/src/eiskaltdcpp/dcpp/BufferedSocket.h:28,
                  from
 /home/pavel/src/eiskaltdcpp/dcpp/HttpConnection.h:21,
                  from /home/pavel/src/eiskaltdcpp/extra/dyndns.h:21,
                  from /home/pavel/src/eiskaltdcpp/extra/dyndns.cpp:19:
 /home/pavel/builds/mxe/usr/i686-w64-mingw32.shared/include/boost/interprocess/detail/win32_api.hpp:
 In function 'bool
 boost::interprocess::winapi::get_last_bootup_time(std::string&)':
 /home/pavel/builds/mxe/usr/i686-w64-mingw32.shared/include/boost/interprocess/detail/win32_api.hpp:2255:19:
 error: 'libintl_sprintf' is not a member of 'std'
                    std::sprintf(&stamp_str[0], "%u", ((unsigned
 int)pTypedRecord->TimeGenerated));
                    ^
 /home/pavel/builds/mxe/usr/i686-w64-mingw32.shared/include/boost/interprocess/detail/win32_api.hpp:2255:19:
 note: suggested alternative:
 In file included from /home/pavel/src/eiskaltdcpp/dcpp/stdinc.h:92:0,
                  from /home/pavel/src/eiskaltdcpp/extra/dyndns.h:20,
                  from /home/pavel/src/eiskaltdcpp/extra/dyndns.cpp:19:
 /home/pavel/builds/mxe/usr/i686-w64-mingw32.shared/include/libintl.h:362:12:
 note: 'libintl_sprintf'
  extern int sprintf (char *, const char *, ...);
             ^
 }}}
 This compilation error disappears if you remove the prefix "std::".
 The code contains the string "std::sprintf" enclosed in #ifdef:
 {{{
 #ifdef BOOST_INTERPROCESS_BOOTSTAMP_IS_LASTBOOTUPTIME
 .
 .
 #else
 .
 .
 std::sprintf(&stamp_str[0], "%u", ((unsigned
 int)pTypedRecord->TimeGenerated));
 .
 .
 #endif
 }}}
 BOOST_INTERPROCESS BOOTSTAMP_IS_ LASTBOOTUPTIME not defined in mingw.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11872>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC