Liste des Groupes | Revenir à l c |
Julio Di Egidio <julio@diegidio.name> writes:I would indeed call that a change!On 08/01/2025 17:48, Andrey Tarasevich wrote:[...]No, `free` doesn't (necessarily) change the pointed-to data.It is perfectly safe. One can even argue that standard declaration>
if `free` as `void free(void *)` is defective. It should have been
`void free(const void *)` from the very beginning.
I do not understand that: `free` is changing the pointed data, so how
can `const void *` even be "correct"?
Any attempt to access the allocated data after free() has undefined
behavior,
so it might be modified, but all free() needs to do is
make it available for further allocation. It might do so without
touching the data itself.
Les messages affichés proviennent d'usenet.