From owner-freebsd-standards Tue Sep 3 0: 3:59 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F0D7337B400; Tue, 3 Sep 2002 00:03:55 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id B514143E65; Tue, 3 Sep 2002 00:03:54 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id HAA06288; Tue, 3 Sep 2002 07:03:52 GMT Date: Tue, 3 Sep 2002 17:11:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Mike Barcroft Cc: standards@FreeBSD.org Subject: Re: Conformance bugs in , by way of In-Reply-To: <20020902140549.E94253@espresso.q9media.com> Message-ID: <20020903165059.Q6101-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 2 Sep 2002, Mike Barcroft wrote: > >From rev 1.5 of ctype.h: > ... > o TODO: fix conformance bugs brought by including . > > I'd appreciate comments of the attached patch which fixes this issue > and brings up to conformance. > ctype.diff > > o Fix namespace scope issues in by using the relatively new > visibility primitives. > o Implement _tolower() and _toupper() POSIX.1-2001 (XSI) macros in > . > o Make pollutant-free so that it can safely be included > in . > o Add a typedef in to compensate for being > pollutant-free. > > Index: ctype.h > =================================================================== > RCS file: /work/repo/src/include/ctype.h,v > retrieving revision 1.22 > diff -u -r1.22 ctype.h > --- ctype.h 21 Aug 2002 16:19:55 -0000 1.22 > +++ ctype.h 2 Sep 2002 18:07:04 -0000 > ... > @@ -85,9 +81,15 @@ > int tolower(int); > int toupper(int); > > -#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) > -int digittoint(int); > +#if __XSI_VISIBLE > +int _tolower(int); > +int _toupper(int); > int isascii(int); > +int toascii(int); > +#endif It would be nice to not support mistakes like XSI. > Index: runetype.h > =================================================================== > RCS file: /work/repo/src/include/runetype.h,v > retrieving revision 1.7 > diff -u -r1.7 runetype.h > --- runetype.h 21 Aug 2002 16:19:55 -0000 1.7 > +++ runetype.h 2 Sep 2002 17:18:18 -0000 > ... > @@ -67,9 +50,9 @@ > * The lower 8 bits of runetype[] contain the digit value of the rune. > */ > typedef struct { > - rune_t min; /* First rune of the range */ > - rune_t max; /* Last rune (inclusive) of the range */ > - rune_t map; /* What first maps to in maps */ > + __rune_t min; /* First rune of the range */ > + __rune_t max; /* Last rune (inclusive) of the range */ > + __rune_t map; /* What first maps to in maps */ > unsigned long *types; /* Array of types in range */ > } _RuneEntry; > > ... There is still a lot of pollution here: all the struct member names, which don't even have a runetype-specific prefix (#define min runetype loses). There doesn't seem to be any good way to fix this. The inline functions in ctype need to reference at least the runetype[] struct member. Renaming the struct members to have a prefix like __ru_ would be ugly and might break documented runetype interfaces. Most of the interfaces seem to be private so this might not be a problem. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message