This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for isdigit/isalpha/etc. macro arguments


> From: Andreas Schwab <schwab@suse.de>
> Cc: sje@cup.hp.com, gdb-patches@sourceware.org
> Date: Sat, 07 Apr 2007 08:18:19 +0200
> 
> >   char *s = "...";
> >   isalpha(*s);
> >
> > is perfectly reasonable code and should not result in compiler
> > warnings.
> 
> This will crash and burn if *s < 0.  You really need to cast to unsigned
> char if you want to get defined behaviour.

Isn't that the job of the isalpha implementation?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]