Re: trim whitespace
- From: Kelsey Bjarnason <kbjarnason@xxxxxxxxx>
- Date: Wed, 25 Aug 2010 17:19:41 -0700
[snips]
On Wed, 25 Aug 2010 15:26:00 +0000, John Kelly wrote:
When I originally asked you to say what the contract was between the
caller and the callee, this was one of the things that you could ave
specified: the code works only on such-and-such type machines. In
effect you did specify that when you said the contract is defined by
what the code does. I.e. you wrote trim for machines where it works
Aside from the ptrdiff_t issue, how can it fail?
and, presumably, you don't care about ones where it won't.
Segfaulting is a caller's error, not a defect in trim(). What other
failure scenario is there?
Err... wasn't one of the key features of your trim() that if fed an
invalid pointer, it would simply march along, trimming memory?
That could very well lead to reading memory you don't own, causing a
segfault - or worse - yet be perfectly consistent with the described
operation of the function - and thus, not a caller error at all.
.
- References:
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: Shao Miller
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: Shao Miller
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: Shao Miller
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: James
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- From: Ben Bacarisse
- Re: trim whitespace
- From: John Kelly
- Re: trim whitespace
- Prev by Date: Re: trim whitespace
- Next by Date: Re: trim whitespace v3
- Previous by thread: Re: trim whitespace
- Next by thread: Re: trim whitespace
- Index(es):
Relevant Pages
|