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

Martin Porter martin.porter@grapeshot.co.uk
Mon Nov 3 08:55:01 2003


In ANSI C labels cannot appear by themselves but must be attached to
statements, so the Snowball generated code is clearly in error here. It is
of course an unnecessary restriction, which is presumably why we've got away
with it for as long as we have.

The easiest solution is to follow each label with a semicolon, lab12:;
lab37:; etc. This is clumsy but I'm still tempted to go for it.

I recall Richard had the same problem with his Java codegenerator, and went
to some lengths to identify labels at the ends of blocks. Why he did not opt
for the simpler solution I've just suggested I do not remember now - perhaps
he can comment. If it was just to generate elegant code perhaps I should
follow his scheme in generating the ANSI C code so as not to be outdone.

Charlie, is this detail holding you back?

Martin