[ Obnoxious '#' quoting character fixed. ]
SM Ryan <wy*****@tang o-sierra-oscar-foxtrot-tango.fake.org> writes:
ro******@ibd.nr c-cnrc.gc.ca (Walter Roberson) wrote: In article <11************ *@corp.supernew s.com>,
SM Ryan <wy*****@tang o-sierra-oscar-foxtrot-tango.fake.org> wrote:ro******@ibd.n rc-cnrc.gc.ca (Walter Roberson) wrote:
> My user and I would be happy to live with whatever the interface
> specification -is-, but what *is* that specification?? Where is it
> written in the C89 standard what exactly will happen?
The specification is the input pointer value is generally no longer valid
and should not be used again in any calls or memory references;
Could you be so kind as to indicate where in C89 that specification
is given?
page 155 line 19-20
page 156 line 22-24
page 144 line 14-16
My copy of the C90 standard (ANSI/ISO 9899-1900) does not have line
numbers on each page. I own both a hard copy (the left-hand pages of
Schildt's annotated version) and a soft copy, in PDF format. I do not
have a copy of the actual 1989 ANSI standard; my understanding is that
they are essentially identical except for some introductory matter and
some changes in the section numbering. Apparently the page numbers
also changed. Page 155 of the C90 standard does contain the
description of the realloc function, but page 156 describes atexit,
exit, and getenv, and page 144 describes ungetc and fread.
It's more useful to provide section numbers rather than page numbers.
For example, C90 7.10.3.4 describes the realloc function; that's
probably 4.10.3.4 in the C89 ANSI standard. It's even more useful to
provide brief quotations (I believe that's covered under fair use, but
IANAL).
Earlier today, I posted a followup in this thread, message-id
<ln************ @nuthaus.mib.or g>, in which I directly quoted the
section of the C90 standard that describes realloc(). Perhaps you can
reply to that and point out what you think I'm missing. It's
available at
<http://groups-beta.google.com/group/comp.lang.c/msg/988166ae47c087c b>.
I've been reading and re-reading 4.10.3 "Memory Management
Functions" and I cannot seem to find any wording to that effect.
If you wanted a verbatim transcript of the copyrighted work, why not ask
for it. Or if you have a copy and can't understand it, why do you need
someone to repeat words you are apparently incapable of understanding?
Or are you simply interesting in creating an argument because
you're bored?
I have also read the corresponding section of the C90 standard, and I
cannot find any explicit wording about the circumstances in which
realloc deallocates memory. We all know that that's the intent, but I
can't find the wording that expresses that intent.
In my opinion, the description of realloc in the C89/C90 standard was
poorly worded, and did not actually state that the old block of memory
is deallocated if a new one is allocated. This flaw is corrected in
the C99 standard, and commented on in the C99 Rationale.
It's entirely possible that I've missed something in the C90 standard
that makes this point clear. If so, I invite you to point it out to
us. Please note that insults about my reading comprehension skills do
not constitute pointing it out.
--
Keith Thompson (The_Other_Keit h)
ks***@mib.org <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.