Re: [Snowball-discuss] Compiling with VC++ 6?

From: Martin Porter (martin_porter@softhome.net)
Date: Fri Apr 19 2002 - 14:59:24 BST


Dear jsmith,

You may know that Snowball was recently altered to look after 16 bit
characters as readily as 8 bit characters, and at that time all these
{a,b,c...} declarations crept in. Of course, {'a','b','c'} is one character
shorter than "abc", because there is no zero terminator, hence the problem
with null lists.

I can't convince myself that null lists violate ANSI C, but even so:---

I've altered Snowball so that declarations of the form

    static symbol some_name[0] = { };

are everywhere suppressed. Where 'some_name' would appear in the code there
now appears '0', and this works in all the 'among' structures where null
strings get used.

There is another context in which null strings may be generated, although
the Snowball scripts on the website contain no examples of this. It
ultimately causes a call to

    memcmp(p,q,n);

where n==0 and q==0. With my gcc, memcmp(x,y,0) always returns 0, as you
would expect, and I think I'll leave it like that. Or does anyone know of
situations where memcmp crashes if n==0 and p and q are not valid memory
addresses?

I've just done a commit to the website. Everything should be in place in a
few hours.

Martin

_______________________________________________
Snowball-discuss mailing list
Snowball-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/snowball-discuss



This archive was generated by hypermail 2.1.3 : Thu Sep 20 2007 - 12:02:41 BST