Skip to content

Enable clang warnings for uninitialized variables/structs - #2424

Merged
Vishal Sharma (vcsharma) merged 2 commits into
microsoft:masterfrom
vcsharma:user/visshar/bugfix
Aug 22, 2019
Merged

Vishal Sharma (vcsharma) merged 2 commits into
microsoft:masterfrom
vcsharma:user/visshar/bugfix

Conversation

@vcsharma

Copy link
Copy Markdown
Contributor

As listed in issue #2419, unlike DXC, FXC has some support for generating diagnostic for uninitialized variables/structs (which is rather inconsistent). For example, FXC generates error for uninitialized variables, but only warns for uninitialized structs. Also, FXC fails to generate any warning when variables "may" be uninitialized (e.g., when initialized conditionally). This PR enables Clang warning for uninitialized variables/structs which produces much better diagnostic than FXC.

Fixes #2419

@vcsharma Vishal Sharma (vcsharma) changed the title User/visshar/bugfix Enable clang warnings for uninitialized variables/structs Aug 22, 2019
@AppVeyorBot

Copy link
Copy Markdown

@hekota Helena Kotas (hekota) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@tiago-rodrigues

Tiago Rodrigues (tiago-rodrigues) commented Nov 15, 2019 •

Copy link
Copy Markdown

Would there be a pragma we could use to silence this warning? This is actually hanging our build environment (as the VS output windows appears to get a bit 'overwhelmed' by the number of messages coming from our distributed shader compilation system) so we wanted to selectively 'mute it' for a few files.

@vcsharma

Copy link
Copy Markdown
Contributor Author

Tiago Rodrigues (@tiago-rodrigues), are you hitting the case of spurious warnings as described in #2494? DXC supports a flag -no-warnings to globally suppress all warnings. We could also consider disabling this warning altogether until #2494 is fixed.

@tiago-rodrigues

Copy link
Copy Markdown

Vishal Sharma (@vcsharma), sorry for the late reply. Yes I was hitting the case in #2494. Thanks for MR for the warning disable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DXC exhibits different behavior than FXC when encountering uninitialized variables

4 participants