From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15621 invoked by alias); 9 Apr 2007 13:43:00 -0000 Received: (qmail 15613 invoked by uid 22791); 9 Apr 2007 13:43:00 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 09 Apr 2007 14:42:53 +0100 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l39DgpJm029378; Mon, 9 Apr 2007 09:42:51 -0400 Received: from post-office.corp.redhat.com (post-office.corp.redhat.com [172.16.52.227]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l39DgpTp026623; Mon, 9 Apr 2007 09:42:51 -0400 Received: from greed.delorie.com (vpn-14-8.rdu.redhat.com [10.11.14.8]) by post-office.corp.redhat.com (8.12.11.20060308/8.11.6) with ESMTP id l39DgpH1016432; Mon, 9 Apr 2007 09:42:51 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1]) by greed.delorie.com (8.13.8/8.13.8) with ESMTP id l39DgoFQ013030; Mon, 9 Apr 2007 09:42:50 -0400 Received: (from dj@localhost) by greed.delorie.com (8.13.8/8.13.8/Submit) id l39DgoX1013027; Mon, 9 Apr 2007 09:42:50 -0400 Date: Mon, 09 Apr 2007 13:43:00 -0000 Message-Id: <200704091342.l39DgoX1013027@greed.delorie.com> From: DJ Delorie To: schwab@suse.de CC: gdb-patches@sourceware.org In-reply-to: (message from Andreas Schwab on Mon, 09 Apr 2007 15:20:31 +0200) Subject: Re: Patch for isdigit/isalpha/etc. macro arguments References: X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00068.txt.bz2 > The value of '\377' is implementation-defined. Not in the context of fgetc or (the places where ambiguity exists), it isn't (emphasis mine): "If the end-of-file indicator for the input stream pointed to by stream is not set and a next character is present, the fgetc function obtains that character as an UNSIGNED CHAR converted to an int and advances the associated file position indicator for the stream (if defined)." "The header declares several functions useful for classifying and mapping characters. In all cases the argument is an int, the value of which shall be representable as an UNSIGNED CHAR or shall equal the value of the macro EOF. If the argument has any other value, the behavior is undefined. It is, unfortunately, up to the programmer to deal with other sources of character data which may be sign extended, and provide the ctype macros with the input range they're expecting. In the case of casts from char* strings, the programmer should: isalpha((int)(unsigned char)(*s)) Messy, but pedantic. The cast to int may be optional.