Bug 39 - Build warning: stun_server_ctx.c:347:11: warning: variable ‘hmacPassword’ set but not used [-Wunused-but-set-variable]
Summary: Build warning: stun_server_ctx.c:347:11: warning: variable ‘hmacPassword’ set...
Status: NEW
Alias: None
Product: resiprocate
Classification: Unclassified
Component: stack (libresip) (show other bugs)
Version: unspecified
Hardware: Other Linux
: P1 normal
Assignee: Owner of all unassigned bugs
Depends on:
Reported: 2013-03-11 18:29 CDT by Daniel Holbert
Modified: 2013-03-11 18:31 CDT (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Holbert 2013-03-11 18:29:51 CDT
When compiling mozilla-central (the firefox nightly source code), I get this build warning when building this third-party library:
nICEr/src/stun/stun_server_ctx.c: In function ‘nr_stun_server_send_response’:
nICEr/src/stun/stun_server_ctx.c:347:11: warning: variable ‘hmacPassword’ set but not used [-Wunused-but-set-variable]

The warning is correct -- the code goes to the trouble of setting hmacPassword, but it never uses the value. It looks like this:

> static int nr_stun_server_send_response(...)
>   {
>     Data *hmacPassword;
>     if (clnt) {
>         hmacPassword = &clnt->password;
>     }
>     else {
>         hmacPassword = 0;
>     }
...and then it just never uses hmacPassword.

From inspection, it looks this is still an issue in the latest version of this code on SVN (rev 10043):

Presumably this variable can just be removed?