azure-c-shared-utility icon indicating copy to clipboard operation
azure-c-shared-utility copied to clipboard

Change variable name to avoid variable shadowing

Open JoseSanchez7 opened this issue 3 years ago • 0 comments

Problem: When compiling with ARM, a warning is given that variable shadowing is possibly occurring. This was caused by the object type and a variable of that type having the same name (despite having different capitalization). While the compiler understands what's going on, it may lead to errors in understanding for others reading the code.

Solution: Changing the variable name resolved the issue.

Links for more info:

https://stackoverflow.com/questions/38533407/how-bad-is-redefining-shadowing-a-local-variable

https://stackoverflow.com/questions/15066925/same-name-but-with-different-case-variable-and-function-names-in-c

JoseSanchez7 avatar Jul 29 '22 17:07 JoseSanchez7