From owner-freebsd-standards@FreeBSD.ORG Tue Jun 24 11:49:27 2003 Return-Path: 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 513B937B401; Tue, 24 Jun 2003 11:49:27 -0700 (PDT) Received: from smtp3.server.rpi.edu (smtp3.server.rpi.edu [128.113.2.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6871043F85; Tue, 24 Jun 2003 11:49:26 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp3.server.rpi.edu (8.12.9/8.12.9) with ESMTP id h5OInOWa004869; Tue, 24 Jun 2003 14:49:24 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20030624124233.GA83552@nagual.pp.ru> References: <20030624114418.GA58305@HAL9000.homeunix.com> <20030624124233.GA83552@nagual.pp.ru> Date: Tue, 24 Jun 2003 14:49:22 -0400 To: Andrey Chernov , standards@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: unclaimed-spam X-Scanned-By: CanIt (www . canit . ca) cc: das@freebsd.org Subject: Re: scanf(3) patch for C99-conformant FP parsing X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2003 18:49:27 -0000 At 4:42 PM +0400 6/24/03, Andrey Chernov wrote: >BTW, in all cases calling is*() macros on char may have side >effects, you need to promote argument to (unsigned char) first. For what it's worth, I like to use the following #define'd macros for using the is*() and to*() routines with byte values. These have worked well for me, if for no other reason than they explicitly remind me that I have to do something for char types... /* * All the standard is*() routines are defined to work on an 'int', * in the range of 0 to 255 plus EOF (-1). So we define wrappers * which can take values of type 'char', either signed or unsigned. */ #define isdigitch(Anychar) isdigit(((int) Anychar) & 255) #define isupperch(Anychar) isupper(((int) Anychar) & 255) #define isxdigitch(Anychar) isdigit(((int) Anychar) & 255) #define tolowerch(Anychar) tolower(((int) Anychar) & 255) -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu