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

Re: cvs commit: src/include ctype.h src/lib/libc/gen isctype.c tolower.c toupper.c

From: Chris Pressey <cpressey@xxxxxxxxxxxxxxx>
Date: Thu, 7 Jul 2005 11:30:03 -0700

On Thu, 7 Jul 2005 10:36:29 -0700 (PDT)
Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx> wrote:

> :> Currently return 0 if the integer is
> :> out of range (it might be more appropriate to assert).
> :
> :It is definately more appropriate to assert IMO.
> :
> :-Chris
>     Well, it's hard to say.  If the standard said we should assert,
>     then we should assert.

Obviously ;)

>     But the programmer might not have the expectation  
>     of an is*() call *EVER* causing the program to exit.

If the behaviour is undefined, then the programmer is not allowed to
have expectations.  And it's courteous of us to inform them of their
unwarranted expectations, in as explicit a way as possible.  To me,
this means an assert.

If you're worried about programs that have been written to a lower
standard, such that they rely on behaviour that the (actually
in-effect-now) standard has since defined as "undefined", then I'd have
to go back to the idea of a conformancy switch.  i.e.:  Be liberal in
what we accept and strict in what we produce AND have an optional switch
that makes us strict in what we accept.

Just my 2c,

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