This is the mail archive of the
mailing list for the GCC project.
Re: malloc attributes and realloc
Robert Dewar <email@example.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 :-)