Repository navigation
[linux-port] Eliminate warnings on release builds - #247
Conversation
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
|
❌ Build DirectXShaderCompiler 1.0.202 failed (commit c930224c83 by @pow2clk) |
|
✅ Build DirectXShaderCompiler 1.0.208 completed (commit fbbf51c165 by @pow2clk) |
| else { | ||
| assert(rootSigMinor == 1 && | ||
| "else CGMSHLSLRuntime Constructor needs to be updated"); | ||
| "else HLSLRootSignatureAction Constructor needs to be updated"); |
| const bool isMat = | ||
| TypeTranslator::isMxNMatrix(exprType, nullptr, &numRows, &numCols); | ||
| assert(isMat); | ||
| (void)isMat; |
There was a problem hiding this comment.
i think you meant to add (void)isMat after the assert rather than replacing the assert?
| assert(std::all_of(argTypes.begin(), argTypes.end(), | ||
| isCanonicalAsParam)); // HLSL Change - skip array when | ||
| // check isCanonicalAsParam | ||
| (void)isCanonicalAsParam; // check isCanonicalAsParam |
There was a problem hiding this comment.
nit: the comment belongs to the line above, not (void).... Place (void)... on the next line.
There was a problem hiding this comment.
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
|
Thanks for the review! Changes submitted. |
|
✅ Build DirectXShaderCompiler 1.0.211 completed (commit 7bcef24d10 by @pow2clk) |
|
Thank you! |
|
Please post to MS repo as well. Thanks. |
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