DragonFly BSD
DragonFly commits List (threaded) for 2005-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: ctype bug


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Thu, 7 Jul 2005 02:09:18 +0200

Lately Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx> said:

> On Wed, Jul 06, 2005 at 04:45:08PM -0700, Matthew Dillon wrote:
> > 
> > :*sigh* Which behaviour should be used instead? It can't return an error,
> > :because this functions are not supposed to return errors. Second, it can't
> > :return an arbitrary value, because that can be considered wrong too.
> > :Third, it can't magically cast them to unsigned, because 255 is a valid letter
> > :in UTF8, but also (signed)255 == EOF.
> >     Joerg, just because the standard says undefined doesn't give us license
> >     to allow an API function to randomly overflow an array and return garbage.
> >     It just doesn't, and we aren't going to do it.  It's totally
> >     inappropriate, in fact.  libc has to be more robust then that. 
> It returns as much garbage as FreeBSD returned. Returning '0' for an invalid
> argument is as invalid as any other value.

it's not invalid. it's "undefined". but in a way we think it makes sense.
strictly conforming programs won't have problems with that.

cheers
  simon

-- 
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low $$$ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \

Attachment: pgp00012.pgp
Description: PGP signature



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]