-
-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
Add -Wshadow=local to warnings and fix reported issues (#25316). #25853
Conversation
37e7ca9
to
bda08d2
Compare
a249cc5
to
53e389f
Compare
I think it makes more sense for names to contain some information about the variable meaning, not just add "2" suffix. |
53e389f
to
dd5ae9f
Compare
Sure, that makes perfectly sense, but my project knowledge is very low. The "2" suffix was the easiest way how to deal with it. Note that even using loop names as |
I can have a look at each occurrence to find better names if you want, and amend the commit accordingly. |
Great, I would appreciate that. |
dd5ae9f
to
8d51618
Compare
I reviewed a few of occurrences, but eventually had to give up in front of the sheer amount. |
return MARSHALLED_IN(Plane, (GDMonoMarshal::M_Plane *)mono_object_unbox(p_obj)); | ||
|
||
if (mono_class_is_enum(tclass->get_mono_ptr())) | ||
if (mono_class_is_enum(vtclass->get_mono_ptr())) |
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.
Why are all the previous tclass
locals being renamed?
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.
Sorry, GH didn't show me your comment before I clicked "merge" somehow.
In this method, all the tclass
in this local scope were shadowing the definition at line 580:
GDMonoClass *tclass = GDMono::get_singleton()->get_class(mono_object_get_class(p_obj));
The renamings in the other methods are actually a mistake, I acted based on a list of -Werror=shadow-local
errors and didn't properly check the line numbers.
Thanks @marxin for the impressive work! |
I've made a mechanical changes in order to silent the warning.
I'm also attaching a script that I used to compare that objdump -S is identical (
objdump-S.diff
).Moreover, I checked that .roda and .data are equal mudulo git revision and new assert strings (
objdump-data-rodata.diff
), it's quite nicely seen in output ofstrings
command (strings.diff
).Please tell me what you think about the changes?
difference.tar.gz