Boost logo

Boost :

Subject: Re: [boost] [test] Use of snprintf
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2009-11-23 19:14:47


Gennadiy Rozental wrote:
> Mateusz Loskot <mateusz <at> loskot.net> writes:
>
>> Hi,
>>
>> I'm testing Boost with Comeau C/C++ frontent which,
>> as far as I found, does not support mixing C++ and C99 modes.
>> So, compiling Boost.Test library fails because ::snprintf
>> can not be found [1].
>
>> Would it make sense to remove use of snprintf?
>
> I'd like to continue using snprintf. Can please provide any kind of workaround?

Gennadiy,

I've prepared a simple workaround for missing snprintf and vsnprintf
functions. Patch attached to the ticket [1]

Due to the fact that these functions are used not only in Boost.Test,
I thought it may be a good idea Boost.Config gives some hints about
their availability, so I also updated boost/config/platform/linux.hpp
with two definitions for Linux && Comeau

# define BOOST_NO_SNPRINTF
# define BOOST_NO_VSNPRINTF

I have very little knowledge about internals of Boost.Config,
so I'm not sure if that is proper approach.

By the way, I also submitted new ticket [2] with small patch
that enables POSIX/SVID support for Comeau toolset.

To summary, these two patches fix the related problems,
however I found some further issues which I'm investigating,
and hopefully, patching.

[1] https://svn.boost.org/trac/boost/ticket/3558
[2] https://svn.boost.org/trac/boost/ticket/3662

Best regards,

-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk