Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jan 1995 22:58:52 -0600 (CST)
From:      Peter da Silva <peter@bonkers.taronga.com>
To:        terry@cs.weber.edu (Terry Lambert)
Cc:        ache@astral.msk.su, phk@ref.tfs.com, dgy@seagull.rtd.com, freebsd-hackers@freefall.cdrom.com, roberto@blaise.ibp.fr
Subject:   Re: CVS stuff
Message-ID:  <199501170458.WAA10312@bonkers.taronga.com>
In-Reply-To: <9501161740.AA23380@cs.weber.edu> from "Terry Lambert" at Jan 16, 95 10:40:44 am

next in thread | previous in thread | raw e-mail | index | archive | help
> Any code that uses a signed character as an lvalue for a getch/getc, and
> then checks for -1.

That code is broken whether or not you're considering localization, simply
from portability reasons. There are compilers that accept most legal ANSI C
code but do not support the "signed" keyword (or even silently ignore it!).
(see, deansi.c)

Yes, these compilers are broken... but they exist. Writing code that breaks
as badly as this will (can you say infinite loop on EOF) when it's so easy
to do it right and the correct type for getchar() has been so heavily
advertised is just plain stupid.

> Most code is, by definition, poorly equipped for localization.  It's a
> question of where you draw your line in the sand.

I draw my line on the portability front.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199501170458.WAA10312>