Re: [Snowball-discuss] Problem with compiling Snowball under Visual C++

From: James Aylett (
Date: Sun Nov 02 2003 - 12:42:02 GMT

On Fri, Oct 31, 2003 at 04:45:20PM -0000, Charlie Hull wrote:

> 1. All the individual stemmers are held in files called 'stem.c'. This means
> that Visual C++ attempts to compile them into object files called 'stem.obj'
> and then gets most confused at link time. I can get round this by some
> automated renaming of the sources so it's not a huge problem.

Are you trying to build this within a VC++ workspace, or just using
the command line tools directly?
> 2. In most of the stem.c files there are structures as follows:
> switch(x)
> {
> ...
> case 12:
> {
> if(something) then goto lab4;
> [do something to be skipped]
> lab4: <--- compiler error here "missing ';' before '}"
> }
> break;
> ...
> }
> If I add a ';' just after the label then the compiler is happy. Does anyone
> have any comment?

I don't have K&R here at home, but the thing that strikes me is that a
label probably labels a /statement/, and that the above code doesn't
do that. So adding the ';' after lab4 would be correct (if I'm right
about that). If the above is correct, VC++ is probably making the
assumption that there'll be a statement after a label.

I imagine there's a good reason why the skipped section isn't just
wrapped in a conditional - I haven't looked at the C generator within
Snowball. It shouldn't hurt anything for it always to output an empty
statement (just the ';') after any label it generates, although poor
quality compilers might generate less efficient code in the above


  James Aylett                                                             

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