Hi, I was reported an issue with Boost.Log which fails to compile with Sun Pro compiler because it has non-compliant standard C headers. I was wondering if there is a policy or recommendation for dealing with this kind of problems. I know there is Boost.Compatibility [1] created exactly for this problem. There are many places I include C headers in my code, so relying on Boost.Compatibility would be an ideal solution for me so I don't have to cripple my code. However, I see that many libraries deal with missing std::C symbols themselves. Why do that and not leave it to Boost.Compatibility? By that I mean require users to add it in include path of the compiler. There is one more point to consider. The issue with the broken standard headers is a sign of an ancient compiler. And if the compiler vendor by 2011 (when Sun Studio 12.3 was released) doesn't manage to ship conforming 1998 headers, I'd still consider it an ancient compiler. Boost recently removed (removing?) support for ancient compilers. So, should I bother supporting this compiler at all? [1] http://www.boost.org/doc/libs/1_54_0/libs/compatibility/
On Sat, Sep 21, 2013 at 3:30 PM, Jonathan Wakely
On 21 September 2013 08:31, Andrey Semashev wrote:
Hi,
I was reported an issue with Boost.Log which fails to compile with Sun Pro compiler because it has non-compliant standard C headers.
Non-compliant in what way? Solaris headers are usually pretty strict.
Missing std::swprintf/std::vswprintf. https://svn.boost.org/trac/boost/ticket/9140
On Sat, 21 Sep 2013, Andrey Semashev wrote:
On Sat, Sep 21, 2013 at 3:30 PM, Jonathan Wakely
wrote: On 21 September 2013 08:31, Andrey Semashev wrote:
Hi,
I was reported an issue with Boost.Log which fails to compile with Sun Pro compiler because it has non-compliant standard C headers.
Non-compliant in what way? Solaris headers are usually pretty strict.
Missing std::swprintf/std::vswprintf.
Well, it is boost that is broken. snprintf is not part of C++03, you can't count on cstdio providing it. And in C++11 (when solaris will support that), cstdio will provide std::snprintf but still not ::snprintf unless Oracle completely changes the way solaris headers are organized. Please don't say things like "it has non-compliant standard C headers" when you aren't even talking of C headers. stdio.h does provide snprintf on solaris (possibly depending on some flags to select the relevant standard). -- Marc Glisse
On Sat, Sep 21, 2013 at 7:54 PM, Marc Glisse
On Sat, 21 Sep 2013, Andrey Semashev wrote:
On Sat, Sep 21, 2013 at 3:30 PM, Jonathan Wakely
**wrote: On 21 September 2013 08:31, Andrey Semashev wrote:
Hi,
I was reported an issue with Boost.Log which fails to compile with Sun
Pro
compiler because it has non-compliant standard C headers.
Non-compliant in what way? Solaris headers are usually pretty strict.
Missing std::swprintf/std::vswprintf.
https://svn.boost.org/trac/**boost/ticket/9140https://svn.boost.org/trac/boost/ticket/9140
Well, it is boost that is broken. snprintf is not part of C++03, you can't count on cstdio providing it. And in C++11 (when solaris will support that), cstdio will provide std::snprintf but still not ::snprintf unless Oracle completely changes the way solaris headers are organized.
It's not about snprintf, it's about swprintf and vswprintf, both of which are in C++98 standard.
Please don't say things like "it has non-compliant standard C headers" when you aren't even talking of C headers. stdio.h does provide snprintf on solaris (possibly depending on some flags to select the relevant standard).
The C++ standard defines a number of headers which define C components. These headers are part of the standard, and if a compiler doesn't implement them right, the compiler is non-compliant. I don't see the other way to put it.
On Sat, 21 Sep 2013, Andrey Semashev wrote:
On Sat, Sep 21, 2013 at 7:54 PM, Marc Glisse
wrote: On Sat, 21 Sep 2013, Andrey Semashev wrote:
On Sat, Sep 21, 2013 at 3:30 PM, Jonathan Wakely
**wrote: On 21 September 2013 08:31, Andrey Semashev wrote:
Hi,
I was reported an issue with Boost.Log which fails to compile with Sun
Pro
compiler because it has non-compliant standard C headers.
Non-compliant in what way? Solaris headers are usually pretty strict.
Missing std::swprintf/std::vswprintf.
https://svn.boost.org/trac/**boost/ticket/9140https://svn.boost.org/trac/boost/ticket/9140
Well, it is boost that is broken. snprintf is not part of C++03, you can't count on cstdio providing it. And in C++11 (when solaris will support that), cstdio will provide std::snprintf but still not ::snprintf unless Oracle completely changes the way solaris headers are organized.
It's not about snprintf, it's about swprintf and vswprintf, both of which are in C++98 standard.
In namespace std if you include cwchar, and in the global namespace if you include wchar.h. The boost header currently includes cwchar and tries to use ::swprintf, that's just wrong. If that's not what the issue is about, you haven't been very clear in your explanations.
The C++ standard defines a number of headers which define C components. These headers are part of the standard, and if a compiler doesn't implement them right, the compiler is non-compliant. I don't see the other way to put it.
"I am misusing those headers". -- Marc Glisse
On Sat, Sep 21, 2013 at 8:27 PM, Marc Glisse
On Sat, 21 Sep 2013, Andrey Semashev wrote:
On Sat, Sep 21, 2013 at 7:54 PM, Marc Glisse
wrote:
On Sat, 21 Sep 2013, Andrey Semashev wrote:
On Sat, Sep 21, 2013 at 3:30 PM, Jonathan Wakely
****wrote: On 21 September 2013 08:31, Andrey Semashev wrote:
Hi,
I was reported an issue with Boost.Log which fails to compile with Sun
Pro
compiler because it has non-compliant standard C headers.
Non-compliant in what way? Solaris headers are usually pretty strict.
Missing std::swprintf/std::vswprintf.
https://svn.boost.org/trac/****boost/ticket/9140https://svn.boost.org/trac/**boost/ticket/9140 <https://svn.**boost.org/trac/boost/ticket/**9140https://svn.boost.org/trac/boost/ticket/9140
Well, it is boost that is broken. snprintf is not part of C++03, you can't count on cstdio providing it. And in C++11 (when solaris will support that), cstdio will provide std::snprintf but still not ::snprintf unless Oracle completely changes the way solaris headers are organized.
It's not about snprintf, it's about swprintf and vswprintf, both of which are in C++98 standard.
In namespace std if you include cwchar, and in the global namespace if you include wchar.h. The boost header currently includes cwchar and tries to use ::swprintf, that's just wrong.
Yes, you're correct. I'll fix the header then.
On 21 September 2013 17:27, Marc Glisse wrote:
On Sat, 21 Sep 2013, Andrey Semashev wrote:
It's not about snprintf, it's about swprintf and vswprintf, both of which are in C++98 standard.
In namespace std if you include cwchar, and in the global namespace if you include wchar.h. The boost header currently includes cwchar and tries to use ::swprintf, that's just wrong.
If that's not what the issue is about, you haven't been very clear in your explanations.
Indeed. A self-contained testcase that includes the right headers and clearly demonstrates a bug would be more helpful than asserting non-compliance. As I said, Solaris headers are usually very strict. That can mean that non-portable code that works on other platforms fails to compile on Solaris, but that's not a problem with the Solaris headers.
The C++ standard defines a number of headers which define C components. These headers are part of the standard, and if a compiler doesn't implement them right, the compiler is non-compliant. I don't see the other way to put it.
"I am misusing those headers".
:-)
participants (3)
-
Andrey Semashev
-
Jonathan Wakely
-
Marc Glisse