Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

4
Is it UB to use an uninitialized non-register-class value?
Post Flair (click to view more posts with a particular flair)
Post Body

I'm trying to figure out if the following is UB: https://godbolt.org/z/4xoK9hWr4

My curiosity stems from reading about the "debian openssl fiasco", which if I understand it correctly, started because of a similar pattern.

So far I've found this statement

If the lvalue designates an object of automatic storage duration that could have been declared with the register storage class (never had its address taken), and that object is uninitialized (not declared with an initializer and no assignment to it has been performed prior to use), the behavior is undefined.

6.3.2.1p2

which seems to not be it because in this case it could not be register class because we are taking a pointer to it. Annex J says this, but my understanding is it's not normative

The value of an object with automatic storage duration is used while it is indeterminate (6.2.4, 6.7.8, 6.8).

Thanks in advance.

Author
Account Strength
100%
Account Age
8 years
Verified Email
Yes
Verified Flair
No
Total Karma
10,202
Link Karma
786
Comment Karma
9,333
Profile updated: 2 days ago
Posts updated: 7 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago