|
|
Log in / Subscribe / Register

C can't do provenance

C can't do provenance

Posted Sep 28, 2024 3:54 UTC (Sat) by foom (subscriber, #14868)
In reply to: C can't do provenance by joib
Parent article: Linus and Dirk on succession, Rust, and more

> comparing the pointer value of a freed pointer is already UB

Correct.

From C23 "6.2.4 Storage durations of objects" (earlier versions say effectively the same):
> If a pointer value is used in an evaluation after the object the pointer points to (or just past) reaches the end of its lifetime, the behavior is undefined. The representation of a pointer object becomes indeterminate when the object the pointer points to (or just past) reaches the end of its lifetime.


The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:

Note: you can avoid this step in the future by logging into your LWN account.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds