Skip to content
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

static analysis: cppcheck: shadowed variables #277

Closed
pabs3 opened this issue Nov 8, 2019 · 2 comments

Comments

@pabs3
Copy link
Contributor

@pabs3 pabs3 commented Nov 8, 2019

cppcheck reports there are some shadowed variables in git master:

$ cppcheck -j1 --quiet --enable=all .
libdiscord.c:2723:11: style: Local variable 'type' shadows outer argument [shadowArgument]
   gint64 type = json_object_get_int_member(data, "type");
          ^
libdiscord.c:2451:59: note: Shadowed declaration
discord_process_dispatch(DiscordAccount *da, const gchar *type, JsonObject *data)
                                                          ^
libdiscord.c:2723:11: note: Shadow variable
   gint64 type = json_object_get_int_member(data, "type");
          ^
libdiscord.c:5991:15: style: Local variable 'data' shadows outer argument [shadowArgument]
  JsonObject *data = json_object_new();
              ^
libdiscord.c:5969:53: note: Shadowed declaration
discord_toggle_mute(PurpleBlistNode *node, gpointer data)
                                                    ^
libdiscord.c:5991:15: note: Shadow variable
  JsonObject *data = json_object_new();
              ^
EionRobb added a commit that referenced this issue Nov 8, 2019
Fixes issue #277
@EionRobb

This comment has been minimized.

Copy link
Owner

@EionRobb EionRobb commented Nov 8, 2019

Thanks again for the static analysis :)

@EionRobb EionRobb closed this Nov 8, 2019
@pabs3

This comment has been minimized.

Copy link
Contributor Author

@pabs3 pabs3 commented Nov 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.