Re: on buffer overflows and insecurity
- From: Keith Thompson <kst-u@xxxxxxx>
- Date: Mon, 24 Sep 2007 15:39:40 -0700
jacob navia <jacob@xxxxxxxxxxxxxxxx> writes:
Eric Sosman wrote:
Richard Harter wrote On 09/24/07 14:34,:
[...]... but then it would need to describe those commonest
I don't quite understand your objection. What we are talking
about are the error codes (that should be) required by the
standard. Clearly the standard cannot specify codes for all
possible errors in all possible implementations. What it can do
is specify that there are codes for the commonest errors.
errors in an unambiguous and system-independent way. Since
Exxx values have no hierarchy or other structure, fopen()
could produce ENOHOPE *or* EBADLUCK *or* some platform-
defined Exxx, but not a superposition of more than one.
If the Standard required that failures due to resource
exhaustion produce EALLGONE, it would thereby prevent the
implementation from using the more informative but platform-
specific ENOCHEESE.
It would be nice to raise the floor on QoI, but not at
the cost of instituting a ceiling.
Of course not, if we use just the lower 3 bits of errno
and leave the rest for the different implementations
Wouldn't that invalidate every existing implementation?
The errno mechanism has some serious problems. I'd like to see some
incremental improvements, such as requiring more functions to set
errno on failure, and *maybe* defining more standard codes than the
current EDOM, EILSEQ, and ERANGE. But any change that breaks existing
code is a non-starter, and any change that breaks existing
implementations will face a great deal of resistance; the payoff would
have to be better than anything I've seen proposed here.
Personally, I'd like to see an exception mechanism in C. Probably
something similar to what C++ has, but with some restrictions, would
have the best chance of being accepted. But before we can seriously
consider adding features to C, we have to deal with the current lack
of support for the current C standard; until C99 is supported, there's
not much point in adding major features to C200X or C201Y.
--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.
- Follow-Ups:
- Re: on buffer overflows and insecurity
- From: user923005
- Re: on buffer overflows and insecurity
- References:
- returning error from main()
- From: junky_fellow@xxxxxxxxxxx
- Re: on buffer overflows and insecurity (was returning error from main())
- From: jacob navia
- Re: on buffer overflows and insecurity (was returning error from main())
- From: Charlie Gordon
- Re: on buffer overflows and insecurity
- From: Ben Bacarisse
- Re: on buffer overflows and insecurity
- From: Richard Tobin
- Re: on buffer overflows and insecurity
- From: jacob navia
- Re: on buffer overflows and insecurity
- From: Mark McIntyre
- Re: on buffer overflows and insecurity
- From: jacob navia
- Re: on buffer overflows and insecurity
- From: Ian Collins
- Re: on buffer overflows and insecurity
- From: jacob navia
- Re: on buffer overflows and insecurity
- From: Eric Sosman
- Re: on buffer overflows and insecurity
- From: Richard Harter
- Re: on buffer overflows and insecurity
- From: $)CHarald van D)&k
- Re: on buffer overflows and insecurity
- From: Richard Harter
- Re: on buffer overflows and insecurity
- From: Eric Sosman
- Re: on buffer overflows and insecurity
- From: jacob navia
- returning error from main()
- Prev by Date: Re: Any preprocessor definition to tell if inline is supported?
- Next by Date: Re: How do I force a compiler error if two #defines exist?
- Previous by thread: Re: on buffer overflows and insecurity
- Next by thread: Re: on buffer overflows and insecurity
- Index(es):
Relevant Pages
|