Modify

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: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc: phantall+boost@…

Description

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>
#else
#include <cstdio>
#endif

... and

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

Attachments (0)

Change History (7)

comment:1 Changed 4 years ago by Andrey Semashev

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

comment:2 Changed 4 years ago by Andrey Semashev

Resolution: fixed
Status: newclosed

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 Andrey Semashev

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Andrey Semashev.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.