Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Oct 1997 14:52:31 +0100 (MET)
From:      Wolfgang Helbig <helbig@Informatik.BA-Stuttgart.DE>
To:        ache@nagual.pp.ru (=?KOI8-R?B?4c7E0sXKIP7F0s7P1w==?=)
Cc:        helbig@Informatik.BA-Stuttgart.DE, hackers@FreeBSD.ORG
Subject:   Re: cvs commit: src/gnu/usr.bin/diff system.h
Message-ID:  <199710261352.OAA08049@rvc1.informatik.ba-stuttgart.de>
In-Reply-To: <Pine.BSF.3.96.971026155824.4417A-100000@lsd.relcom.eu.net> from "[______ ______]" at "Oct 26, 97 04:07:55 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



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