Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: sje@cup.hp.com
Cc: gdb-patches@sourceware.org
Subject: Re: Patch for isdigit/isalpha/etc. macro arguments
Date: Fri, 06 Apr 2007 23:51:00 -0000	[thread overview]
Message-ID: <200704062348.l36NmiwC025816@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <200704062336.QAA17806@hpsje.cup.hp.com> (message from Steve 	Ellcey on Fri, 6 Apr 2007 16:36:06 -0700 (PDT))

> Date: Fri, 6 Apr 2007 16:36:06 -0700 (PDT)
> From: Steve Ellcey <sje@cup.hp.com>
> 
> > Sorry, you obviously spent some serious amount of time fixing this,
> > but I think this is just gross.  It also would just hide the bug
> > mentioned above.  I guess we should use -liberty's "safe-ctype.h"
> > instead.
> 
> Hm, this seems to lead to some new problems.  safe-ctype.h defines
> ISALNUM, ISALPHA, ISDIGIT, etc.  (uppercase) and if I start including
> "safe-ctype.h" instead of <ctype.h>, then I collide with
> readline/chardefs.h in some files (like cli/cli-dump.c) because that
> file includes readline/readline.h which includes readline/chardefs.h
> which has its own definitions of ISALNUM, ISALPHA, ISDIGIT, etc.
> 
> What to do?  My best guess would be to have readline/chardefs.h not
> define these macros if they are already defined.  But now we are
> reaching outside the gdb subdir.

Bleach!  So that's not a viable option.  I think it's time to find the
magic gcc option to turn the warning off.  I mean

  char *s = "...";
  isalpha(*s);

is perfectly reasonable code and should not result in compiler
warnings.  And I really don't like adding the casts you propose.  To
me, a cast is an indication that something naughty is being done, and
that certainly isn't the case here.

Mark


  reply	other threads:[~2007-04-06 23:51 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 [this message]
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
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=200704062348.l36NmiwC025816@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    --cc=sje@cup.hp.com \
    /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