-
Notifications
You must be signed in to change notification settings - Fork 3k
MdeModulePkg: Fix clang build regressions. #11803
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
base: master
Are you sure you want to change the base?
Conversation
|
I mean, maybe we need to merge this in order to get the build back to working. But what started this was an attempt to (presumably) improve code quality, and now we're back to "make the compiler go quiet". The underlying problem of horrendously badly structured code is still there, and this sweeps it under the rug. |
Address the build regressions, introduced in tianocore#11724, tianocore#11688, tianocore#11686 tianocore#11685. These build regressions are for uninitialized variables before use. Signed-off-by: Aaron Pop <[email protected]>
8f0b651 to
dbc3503
Compare
There are changing the same thing, but some additional files that were not covered in your original PR also needed some changes. |
Should i close mine then, basically if yours resolving it. |
| // ignore the selection and go back to reading keys. | ||
| // | ||
| if (MenuOption != NULL ) { | ||
| if (MenuOption == NULL ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are other occurrences of this at https://github.com/tianocore/edk2/pull/11687/files
I count 3 in total. Is it possible to check ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That fact that only one of these has been fixed, when the others occur in the same PR, is actually careless IMO. I'm certainly not flawless - we all make mistakes - but I try hard not to be careless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are other occurrences of this at https://github.com/tianocore/edk2/pull/11687/files I count 3 in total. Is it possible to check ?
I went back through the 4 PRs addressing static analysis problems and found some additional problems. Thanks for reporting them @pierregondois
To reverify functionality, I booted Ovmf ia32,x64 and went into setup and checked the functionality of the menus, to the best of my ability, and did not see any additional problems. Thanks!
11686, 11687, 11688, 11689 included some inverted conditionals during the refactor. While the system booted, some behavior was incorrect based on the inverted conditionals. Signed-off-by: Aaron Pop <[email protected]>
dbc3503 to
3d0fad5
Compare
|
Is it possible to request that this PR be split into two, the first commit staying in this PR and matching the existing PR title, the second commit being split off into its own PR. The two commits address rather different kinds of issues, and I think splitting would make it easier to review, and easier to see (now and in the future) what is going on/went on with these changes and fixes. |
|
|
||
| AppendString = NULL; | ||
| NvConfigExist = NULL; | ||
| Status = EFI_OUT_OF_RESOURCES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't EFI_ABORTED a better choice here? (The failures this is for are not out of resources errors.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hii is a protocol documented in UEFI spec( chapter 34). The spec didn't document to return EFI_ABORTED so this will break protocol consumers and spec complaince.
| NAME_VALUE_NODE *NameValueNode; | ||
| BOOLEAN Find; | ||
|
|
||
| Storage = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is not used uninitialized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are wrong here, about this particular line, @khaliid2040: it is not used uninitialized, clang does not complain about it, and you correctly did not change this line in your PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLANG tends to be stricter than GCC
I am well aware of the issue, I am attempting to work on integrating CLANG builds into CI, so that these issues do not keep recurring, and I had already fixed this set of issues myself, too. (And had only not already created a PR myself because I initially incorrectly assumed they were old bugs - and being worried about submitting these piecemeal, as I have been.)
| LIST_ENTRY *Link; | ||
| BROWSER_STORAGE *BrowserStorage; | ||
|
|
||
| BrowserStorage = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is not used uninitialized.
|
As a minor but valid point, commit message subject lines should not end with period. More substantively, for myself I would prefer commit messages which show what is actually being dealt with, rather than vaguer wording about regressions. So for the first commit, I would prefer: Additionally, in the commit message of the second commit, please add: Fixes: #11814. As mentioned above, I think it would definitely help to split the two commits into two PRs, please. |
Description
Address the build regressions, introduced in #11724, #11688, #11686 #11685.
These build regressions are for uninitialized variables before use.
How This Was Tested
Local CI using clangdwarf as tool chain target.
Integration Instructions
No integration necessary.