Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

[ub] a few more fixes #7888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: ub-ifndr
Choose a base branch
from
Open

Conversation

timuraudio
Copy link

This PR breaks up some \ubdef entries in the UB annex into multiple, more granular entries, for those cases of UB where there is value in distinguishing them. This PR makes the list of UB in the ub-ifndr branch identical to the list of UB provided in Appendix A of P3100R2.

@hsutter hsutter added the ub-ifndr UB and IFNDR Annex label May 24, 2025
Copy link

@shafik shafik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM besides the comments I left.

I may do a run over the wording again.

void *p = malloc(sizeof(int) + sizeof(float)); // undefined behavior, cannot create
// both int and float in same place
int& i = *reinterpret_cast<int*>(p);
float& f = *reinterpret_cast<float*>(p);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this be the point of UB?

CC @jensmaurer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the "malloc" is fine. The comment needs to move to line 34.

@@ -123,78 +127,184 @@
};

float f() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
float f() {
void f() {

\pnum
\begin{example}
\begin{codeblock}
int main() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These next two examples are over indented, was that on purpose?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully not. Please fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ub-ifndr UB and IFNDR Annex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants