Re: ellipsis in switch statements


Subject: Re: ellipsis in switch statements
From: Thomas Fletcher (thomasf@qnx.com)
Date: Tue Jul 11 2000 - 06:38:37 CDT


On Tue, 11 Jul 2000, Tomasz Wegrzanowski wrote:

> On Mon, Jul 10, 2000 at 01:50:05PM -0400, Thomas Briggs wrote:
> >
> > On approximately line 600 of abi/src/wv/text.c is the following chunk of
> > code:
> >
> > case 0x9f ... 0xff:
> > printf("%c", char16);
> > return(1);
> >
> > First of all, I will openly admit that I'm not a C++ guy. I like
> > classes. That's about as far as I go into the deep dark world of C++. And
> > I have to imagine that this is valid C++, or AbiWord wouldn't build on other
> > platforms.
> > However, I'm as certain as I am that I'm breathing that this is invalid
> > C, and that that's why it won't compile on Win32 (the VC++ compiler gets
> > picky due to the file extension). So my question is, what's the best fix
> > for this? Thus far all I've come up with is putting
> >
> > if( (char16 >= 0x9f) && (char16 <= 0xff) )
> > {
> > printf("%c", char16);
> > return(1);
> > }
> >
> > at the top of the function and commenting out the offending block. Is there
> > a more elegant solution that I'm missing? Is this in some strange world
> > valid C? Am I missing something really obvious?
>
> There is more elegant solution : use GNU C :-).
> This is not C/C++ problem but GCC extension.

My personal opinion is that the more elegant solution
is to code it ANSI the first time.

Thomas
-------------------------------------------------------------
Thomas (toe-mah) Fletcher QNX Software Systems
thomasf@qnx.com Neutrino Development Group
(613)-591-0931 http://www.qnx.com/~thomasf



This archive was generated by hypermail 2b25 : Tue Jul 11 2000 - 07:14:28 CDT