Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: DJ Delorie <dj@redhat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb-patches@sourceware.org
Subject: Re: Patch for isdigit/isalpha/etc. macro arguments
Date: Tue, 10 Apr 2007 21:52:00 -0000	[thread overview]
Message-ID: <xnodlv6gov.fsf@greed.delorie.com> (raw)
In-Reply-To: <20070410212125.GG2056@caradoc.them.org>


Daniel Jacobowitz <drow@false.org> writes:
> I think we should decide whether this constitutes a Real Problem,
> and whether we care about it, before we do this.  It seems that
> passing a char to isfoo is not portable, although I could not tell for
> sure from the discussion whether ISO C requires it to work.

ISO C requires you to pass 0..255 or EOF, nothing else, to is*().

If the char might be signed, one must either cast it to unsigned char
or mask it with 0xff before using it as a subscript, else one risks a
negative subscript.  Negative values aren't guaranteed to work with
is*(), although some implementations put a second copy of the ctype
data array in front of the normal one to accomodate values in the
range -128..-1.  I suspect this is mostly to keep uninformed
programmers from bothering the mailing lists with complaints about
is*() not working when really it's the programmer's fault.


  reply	other threads:[~2007-04-10 21:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-06 22:34 Steve Ellcey
2007-04-06 23:06 ` Mark Kettenis
2007-04-06 23:17   ` Steve Ellcey
2007-04-06 23:36   ` Steve Ellcey
2007-04-06 23:51     ` Mark Kettenis
2007-04-06 23:59       ` Steve Ellcey
2007-04-07  6:18       ` Andreas Schwab
2007-04-07  9:16         ` Eli Zaretskii
2007-04-07  9:26           ` Andreas Schwab
2007-04-07 17:32             ` Eli Zaretskii
2007-04-07 17:55               ` Andreas Schwab
2007-04-08  8:00                 ` Eli Zaretskii
2007-04-08  9:32                   ` Andreas Schwab
2007-04-08 14:11                     ` Daniel Jacobowitz
2007-04-10 21:16                       ` Steve Ellcey
2007-04-10 21:21                         ` Daniel Jacobowitz
2007-04-10 21:52                           ` DJ Delorie [this message]
2007-04-11  3:36                         ` Eli Zaretskii
2007-04-09 12:57                 ` DJ Delorie
2007-04-09 13:20                   ` Andreas Schwab
2007-04-09 13:43                     ` DJ Delorie
2007-04-09 14:17                       ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xnodlv6gov.fsf@greed.delorie.com \
    --to=dj@redhat.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox