stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: svn commit: r555006 - /incubator/stdcxx/trunk/src/catalog.cpp
Date Fri, 13 Jul 2007 14:52:50 GMT
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> Sent: Wednesday, July 11, 2007 10:14 PM
>> To: stdcxx-dev@incubator.apache.org
>> Subject: Re: svn commit: r555006 - 
>> /incubator/stdcxx/trunk/src/catalog.cpp
>>
>>> 	* catalog.cpp (catopen): while() loop replaced to for() loop
>>> 	with checking for max iterations.
>> Does this fix a bug?
> 
>   Definitely :)
> 
>   As you can see the __rw_catlist container resized only if i ==
> __rw_catlist.size(),
> but before of that __rw_catlist.size()'th element is accessed in while
> (__rw_catlist[i] != 0)
> and this is undefined behavior.
> 
>> If it does, is the bug easily 
>> reproducible so we can add a test case for it to the bug 
>> tracking database?
> 
>   For the test case the valid catalog should be created (.dll file on
> windows).
> It's not so easy and platform dependent. Of course we can use
> generate_catalog ()
> function from 22.locale.messages.cpp test.

That seems like a good approach. We could use it as the first
step toward providing an easier and portable way to build message
catalogs on Windows as well as other platforms. A portable utility
that takes a source file such as rwstderr.msg or rwstderr.rc as
input and produces a catalog from it suitable for the target
platform.

Martin

Mime
View raw message