Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Programming and international chara Message-ID: <8829@smoke.BRL.MIL> Date: 9 Nov 88 10:37:37 GMT References: <532@krafla.rhi.hi.is> <44200016@uicsrd.csrd.uiuc.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 In article <44200016@uicsrd.csrd.uiuc.edu> mcdaniel@uicsrd.csrd.uiuc.edu writes: > #define iscntrl(c) ( (c) >= 0 && (c) <= 037 ) This is an invalid implementation. The is*() functions may be implemented as macros only if they are "safe" macros (i.e. evaluate the argument only once). Also, for valid arguments (ints in the range 0..CHAR_MAX and EOF) the only negative argument that must be handled is EOF. > . . . Isascii and toascii are defined on all > integer values; the rest are defined only where isascii is > true and on the single non-ASCII value EOF (see stdio(3S)). Because ANSI C does not have an isascii() function, the is*() tests are required to work right for all character values.