On Thu, Mar 19, 2009 at 09:36:28PM +0100, Werner Smekal wrote:
> Hi Andrew,
>
> Andrew Ross wrote:
>> Werner,
>>
>> Please be careful about replacing sprintf with snprintf in the examples. Not 
>> all
>> compilers have snprintf available. Internally in the library we have cmake 
>> checks for
>> this and define appropriate macros for platforms where snprintf is not 
>> available and a
>> dummy wrapper plsnprintf which just calls sprintf.
>>   
> Yes, you're right. I was too eager getting rid of this unsafe functions.  
> I'll revert it.
>> These are defined in plplotP.h for internal use and are not available for 
>> users /
>> examples. Your change as it stands is likely to break this example on some 
>> compilers
>> including I believe Visual C++ and Borland.
>>   
> That's the strange part - I tested these changes with Visual C++ and  
> Borland C++. So plplotP.h must be included somewhere.

I can't see where it would be. I've checked over the examples and the
other headers carefully. The examples only include plplot.h and
plConfig.h. Perhaps the comments in plplotP.h are not true with more
modern versions?

>> One option is to ensure the internal snprintf fixes are externally 
>> available. I'm not
>> sure it is our role to provide this kind of additional functionality in the 
>> plplot API.
>> The other option is to stick with sprintf in the examples, perhaps adding a 
>> comment to
>> say that use of sprintf is discouraged, but for maximum portability we use 
>> it in our
>> examples.
>>   
> I'll revert the changes.

Thanks

Andrew

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to