Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

[linux-port] Eliminate warnings on release builds - #247

Merged
ehsannas merged 3 commits into
google:linuxfrom
pow2clk:relwarn
Jun 20, 2018
Merged

ehsannas merged 3 commits into
google:linuxfrom
pow2clk:relwarn

Conversation

@pow2clk

@pow2clk pow2clk commented Jun 20, 2018 •

Copy link
Copy Markdown

A number of warnings unique to release builds persist. Some of these
same errors were fixed earlier for debug builds, but are different for
release that excludes some of the usage and other code.

DXASSERT_LOCALVAR still took a variadic macro on release builds.
Fixes 85 clang warnings

Expressions used only as conditionals for asserts were not properly
dummied out with (void) cast.
Fixes 7 clang warnings

Variables used only in asserts dummied out.
Fixes 27 clang warnings

Potential uninitilized uses of variables assigned in switches/ifs.
fixes 5 clang warnings

put braces around empty else statements
11 gcc warnings

Helps #206

A number of warnings unique to release buildsi persist. Some of these
same errors were fixed earlier for debug builds.

DXASSERT_LOCALVAR still took a variadic macro on release builds.
Fixes 85 clang warnings

Expressions used only as conditionals for asserts were not properly
dummied out with (void) cast.
Fixes 7 clang warnings

Variables used only in asserts dummied out.
Fixes 27 clang warnings

Potential uninitilized uses of variables assigned in switches/ifs.
fixes 5 clang warnings

put braces around empty else statements
11 gcc warnings

Helps google#206
@AppVeyorBot

Copy link
Copy Markdown

@AppVeyorBot

Copy link
Copy Markdown

@ehsannas ehsannas left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good stuff!

else {
assert(rootSigMinor == 1 &&
"else CGMSHLSLRuntime Constructor needs to be updated");
"else HLSLRootSignatureAction Constructor needs to be updated");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lol. Good catch

const bool isMat =
TypeTranslator::isMxNMatrix(exprType, nullptr, &numRows, &numCols);
assert(isMat);
(void)isMat;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

i think you meant to add (void)isMat after the assert rather than replacing the assert?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yup

Comment thread tools/clang/lib/CodeGen/CGCall.cpp Outdated
assert(std::all_of(argTypes.begin(), argTypes.end(),
isCanonicalAsParam)); // HLSL Change - skip array when
// check isCanonicalAsParam
(void)isCanonicalAsParam; // check isCanonicalAsParam

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: the comment belongs to the line above, not (void).... Place (void)... on the next line.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I sort of see the assert and the dummying out as of a piece. If it didn't require including a new header, I'd use DXASSERT_LOCALVAR, but it's also not very important either way.

responding to review comments. Mistakenly removed an assert,
which is restored. and moved a dummying out away from a potentially
misleading comment
@pow2clk

pow2clk commented Jun 20, 2018

Copy link
Copy Markdown
Author

Thanks for the review! Changes submitted.

@AppVeyorBot

Copy link
Copy Markdown

@ehsannas

Copy link
Copy Markdown

Thank you!

@ehsannas
ehsannas merged commit 0896b81 into google:linux Jun 20, 2018
@ehsannas

Copy link
Copy Markdown

Please post to MS repo as well. Thanks.

@pow2clk
pow2clk deleted the relwarn branch June 27, 2018 11:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants