From owner-freebsd-hackers Sun Oct 26 05:53:52 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id FAA05350 for hackers-outgoing; Sun, 26 Oct 1997 05:53:52 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from rvc1.informatik.ba-stuttgart.de (rvc1.informatik.ba-stuttgart.de [141.31.112.22]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id FAA05344 for ; Sun, 26 Oct 1997 05:53:46 -0800 (PST) (envelope-from helbig@Informatik.BA-Stuttgart.DE) Received: (from helbig@localhost) by rvc1.informatik.ba-stuttgart.de (8.8.7/8.8.5) id OAA08049; Sun, 26 Oct 1997 14:52:32 +0100 (MET) From: Wolfgang Helbig Message-Id: <199710261352.OAA08049@rvc1.informatik.ba-stuttgart.de> Subject: Re: cvs commit: src/gnu/usr.bin/diff system.h In-Reply-To: from "[______ ______]" at "Oct 26, 97 04:07:55 pm" To: ache@nagual.pp.ru (=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=) Date: Sun, 26 Oct 1997 14:52:31 +0100 (MET) Cc: helbig@Informatik.BA-Stuttgart.DE, hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL30 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > On Sun, 26 Oct 1997, Wolfgang Helbig wrote: > > > isascii() is a non ISO-C extension. So better yet we change the > > program in question to make it independent of this bogus assumption. > > isascii() conforms to ISO 9899: 1990 (``ISO C'') No. My reference is P. J. Plauger, ``The Standard C Library'', 1992, Prentice Hall. which claims to quote the ISO 9899: 1990 standard. So if P. J. Plauger lies we have to change the ctype.h file, where ``isascii'' is hidden by the ``_ANSI_SOURCE'' symbol. (According to Plauger, ANSI-C and ISO-C do not differ.) > Sometimes it is not bogus, i.e. when you check DNS name, you need only > ASCII subset for isalpha() Well, not when you have to check DNS names on an IBM mainframe with EBCDIC. > > > 2) Add (unsigned char) cast to all ctype macros calls. Direct cast mask > > > possible programmer errors like ctype(s) instead of ctype(*s). > > > > 2a) Pass an unsigned char (or int with its value in EOF, 0..UCHAR_MAX) > > right away, i. e. change the definition ``char *foo'' to > > ``unsigned char *foo'' whenever possible. > > It is more difficult than 2) and may cause prototypes mismatch and > assignment types conflict but now allows programmer errors of course. Yes. > > > 3) Add -funsigned-char to CFLAGS, it seems to be best way unless some > > > programs assume that char is signed somewhere. Many old BSD programs does. > > > > This makes our source depend on a non portable feature of gcc, which I > > think should be avoided. > > It is beter way for 3rd party software like GNU one since require minimal > source changes. I agree for 3rd party software. > > So I suggest to adopt method 2) and 2a). > > I suggest to adopt the method which best fit to particular situation. Sure. Wolfgang