Ticket #9140 (closed Bugs: fixed)

Opened 4 years ago

Last modified 4 years ago

Building boost::log's snprintf.hpp in Sun Studio 12.3: some functions aren't defined that are expected

Reported by: Brian Vandenberg <phantall+boost@…> Owned by: andysem
Milestone: To Be Determined Component: log
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc: phantall+boost@…


I get the following error building with Sun Studio 12.3:

"./boost/log/detail/snprintf.hpp", line 40: snprintf is not defined.
"./boost/log/detail/snprintf.hpp", line 41: vsnprintf is not defined.
"./boost/log/detail/snprintf.hpp", line 44: swprintf is not defined.
"./boost/log/detail/snprintf.hpp", line 45: vswprintf is not defined.

Changes needed are something along the lines of:

#if defined( __SUNPRO_CC )
#include <stdio.h>
#include <cstdio>

... and

#if defined( __SUNPRO_CC )
using std::swprintf;
using std::vswprintf;
using ::swprintf;
using ::vswprintf;


Change History

comment:1 Changed 4 years ago by andysem

The compiler has non-compliant standard headers. This issue can be worked around by Boost.Compatibility.

comment:2 Changed 4 years ago by andysem

  • Status changed from new to closed
  • Resolution set to fixed

Should be fixed in [85810].

comment:3 Changed 4 years ago by Brian Vandenberg <phantall+boost@…>

I just tried the suggested fix and I'm still seeing errors indicating that snprintf / vsnprintf are not defined.

comment:4 Changed 4 years ago by Brian Vandenberg <phantall+boost@…>

ack. my apologies, I'm experimenting with getting boost::asio to build and have -D_XOPEN_SOURCE=1 in my command-line args ... there's some odd stuff going on with that.

comment:5 Changed 4 years ago by Brian Vandenberg <phantall+boost@…>

  • Cc phantall+boost@… added

comment:6 Changed 4 years ago by andysem

So, is the problem fixed eventually?

comment:7 Changed 4 years ago by Brian Vandenberg <phantall+boost@…>

I should've made that more clear. Yes, I applied the changes you made and the problem gets resolved.


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.