Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#9140 closed Bugs (fixed)

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;

Attachments (0)

Change History (7)

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

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

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 Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain andysem.
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.