Skip to content

Conversation

@jketema
Copy link
Contributor

@jketema jketema commented Sep 11, 2025

No description provided.

@github-actions github-actions bot added the C++ label Sep 11, 2025
@jketema jketema marked this pull request as ready for review September 11, 2025 17:38
@jketema jketema requested a review from a team as a code owner September 11, 2025 17:38
Copilot AI review requested due to automatic review settings September 11, 2025 17:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.


too_many_constants_init(s);

return m;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have an annotation here?

Suggested change
return m;
return m; // BAD -- m has not been initialized
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's GOOD actually. The initialization happens in the omitted too_many_constants_init.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

S s[] = {
{.a = 0, .c = 0, .d = nullptr, .r = {.n = {.e = e, .f = 1, .g = nullptr, .h = h, .i = i, .j = false, .k = k, .l = l, .m = &m}}},
{.a = 0, .c = 0, .d = nullptr, .r = {.q = {.o = true, .p = true}}}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it would be nice with a small comment explaining what the interesting thing being tested here is. Something with too many constants? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing anymore, after the extractor fix I merged yesterday. This test is just here to make sure we do not regress.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then is is testing something interesting right? That we don't regress for some specific case. I'm suggesting it would be nice to write out what the special thing about this case here is. Is it the number of fields, the nesting, etc? It's not clear to me :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to politely refuse, because this is related to internal extractor details. If you want the full story, please follow the link to the internal PR that references this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

To be clear, I'm not suggesting writing anything about the extractor, but that we highlight the interesting/key aspect of the test. I've suggested a comment below.

{.a = 0, .c = 0, .d = nullptr, .r = {.q = {.o = true, .p = true}}}
};

too_many_constants_init(s);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
too_many_constants_init(s);
too_many_constants_init(s); // Initializer being passed a literal with many constants
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now you need to define what a constant is, because the aggregate here clearly isn't. Can we not go down this rabbit hole, please.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see the problem, but ok.

@jketema jketema merged commit a773042 into github:main Sep 12, 2025
9 of 10 checks passed
@jketema jketema deleted the dyn-too-many branch September 12, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants