Date: Thu, 26 Feb 2004 00:59:46 +0100 (CET) From: Stefan Farfeleder <stefan@fafoe.narf.at> To: FreeBSD-gnats-submit@FreeBSD.org Cc: stefan@fafoe.narf.at Subject: standards/63371: [patch] isblank() not in C99/SUSv3 namespace Message-ID: <20040225235946.A3DD57E46@frog.fafoe.narf.at> Resent-Message-ID: <200402260000.i1Q00YmS089056@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 63371 >Category: standards >Synopsis: [patch] isblank() not in C99/SUSv3 namespace >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Feb 25 16:00:34 PST 2004 >Closed-Date: >Last-Modified: >Originator: Stefan Farfeleder >Release: FreeBSD 5.2-CURRENT i386 >Organization: >Environment: System: FreeBSD frog.fafoe.narf.at 5.2-CURRENT FreeBSD 5.2-CURRENT #25: Mon Feb 23 11:19:34 CET 2004 freebsd@frog.fafoe.narf.at:/freebsd/frog/obj/freebsd/frog/src/sys/FROG i386 >Description: C99 standardised the isblank() macro/function which is currently protected by the __BSD_VISIBLE macro and thus fails to be visible in a strict C99/SUSv3 compilation environment. >How-To-Repeat: $ cat isblank.c #include <ctype.h> int main(void) { return isblank('a'); } $ c99 -D_C99_SOURCE isblank.c isblank.c: In function `main': isblank.c:2: warning: implicit declaration of function `isblank' $ c99 -D_POSIX_C_SOURCE=200112L isblank.c isblank.c: In function `main': isblank.c:2: warning: implicit declaration of function `isblank' >Fix: --- isblank.diff begins here --- Index: src/include/ctype.h =================================================================== RCS file: /usr/home/ncvs/src/include/ctype.h,v retrieving revision 1.24 diff -u -r1.24 ctype.h --- src/include/ctype.h 9 Sep 2002 05:38:05 -0000 1.24 +++ src/include/ctype.h 25 Feb 2004 23:18:33 -0000 @@ -89,9 +89,12 @@ int toascii(int); #endif +#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 +int isblank(int); +#endif + #if __BSD_VISIBLE int digittoint(int); -int isblank(int); int ishexnumber(int); int isideogram(int); int isnumber(int); @@ -133,9 +136,12 @@ #define toascii(c) ((c) & 0x7F) #endif +#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 +#define isblank(c) __istype((c), _CTYPE_B) +#endif + #if __BSD_VISIBLE #define digittoint(c) __maskrune((c), 0xFF) -#define isblank(c) __istype((c), _CTYPE_B) #define ishexnumber(c) __istype((c), _CTYPE_X) #define isideogram(c) __istype((c), _CTYPE_I) #define isnumber(c) __istype((c), _CTYPE_D) --- isblank.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040225235946.A3DD57E46>