This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: malloc attributes and realloc


Robert Dewar <dewar@gnat.com> writes:

|  > The specification of realloc does not say the pointer is free()ed.
| 
| Now perhaps it is you that is trying to play too much of the language
| lawyer. You have to be careful in reading a language standard to always
| include the important rule that you can't use the standard to deduce
| something that is obviously wrong :-)

I know how to read the C and C++ standards.  And both of them are not
exempt of errors, self-contradiction and incompleteness.

| In particular, if the language
| of the standard does not reflect the intent, then it is the intent
| that rules,

Do you know the intent?

[...]

| In this case, we know perfectly well that if the realloc has to actually
| allocate a new area of storage, then the old area may be freed, 

Now, it is you who are confusing "free()ed" and "freed".
You have to be careful when reading the C standard :-)

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]