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


On Sun, Apr 08, 2007 at 11:32:34AM +0200, Andreas Schwab wrote:
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> From: Andreas Schwab <schwab@suse.de>
> >> Cc: mark.kettenis@xs4all.nl, sje@cup.hp.com,
> >> 	gdb-patches@sourceware.org
> >> Date: Sat, 07 Apr 2007 19:55:08 +0200
> >> 
> >> How can it distinguish EOF from '\377'?
> >
> > The same way you want the calling code to do that.
> 
> So tell me how to distinguish two identical values?

I don't think we're getting anywhere...

The only thing I can see is that if the caller knows it is not EOF, it
should cast to unsigned char.  Otherwise if there are signed
characters on a platform I don't see any way the library can do the
right thing; the cast to int will leave '\377' == EOF.

-- 
Daniel Jacobowitz
CodeSourcery


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