Re: aspell-0.60-20040416 bug in string_map.hpp

Kevin Atkinson <[email protected]>
Newsgroups gmane.comp.gnu.aspell.devel
Message-ID <Pine.LNX.4.44.0404241535250.1684-100000@kevin-p3.atkinson.dhs.org>
On 24 Apr 2004, Karl Chen wrote:

> >>>>> "Kevin" == Kevin Atkinson <[email protected]> writes:
>     Kevin> 
>     Kevin> On 24 Apr 2004, Karl Chen wrote:
>     >> 
>     >> I had to make the following change to get aspell 20040416
>     >> snapshot to compile with gcc 3.3:
>     Kevin> 
>     >> StringMap(const StringMap & other) : empty_str() {}
>     >> {copy(other);}
>     Kevin> 
>     Kevin> I'm sorry.  This is invalid C++ code.  Furthermore
>     Kevin> since Gcc 3.3 is probably ignoring the {copy(other);}
>     Kevin> it is also not doing the correct thing.  Exactly what
>     Kevin> error are you getting.
> 
> 
> Urh, oops!  I copied&pasted the wrong patch somehow. I meant:
> 
> StringMap(const StringMap & other) : empty_str() {copy(other);}

Ok fixed.

> Gcc 3.3 requires constants (empty_str) to be initialized.  (BTW,
> you could probably make it static const or just write the value
> instead of empty_str)

Its a minor memory optimization.  The idea is to avoid having to 
dereference a distant memory location just to discover that it is the 
empty string.

-- 
http://kevin.atkinson.dhs.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.