Closed
Bug 950344
Opened 11 years ago
Closed 9 years ago
Fix unused-but-set-variable 'client' warning in pkix_pl_httpdefaultclient.c
Categories
(NSS :: Libraries, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: vaduva.andrei.iustin, Assigned: vaduva.andrei.iustin)
Details
Attachments
(1 file, 1 obsolete file)
1.24 KB,
patch
|
elio.maldonado.batiz
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36 Steps to reproduce: I found a build warning in 521:13.14 pkix_pl_httpdefaultclient.c: In function ‘pkix_pl_HttpDefaultClient_KeepAliveSession’: 521:13.16 pkix_pl_httpdefaultclient.c:1135:36: warning: variable ‘client’ set but not used [-Wunused-but-set-variable] - Andrei V 521:13.16 PKIX_PL_HttpDefaultClient *client = NULL; 521:13.16 ^ I intend to fix it.
I moved line 1135 which was initialized with NULL to line 1147 and I initialized it with variable needed. This was my first bug fix.
Attachment #8347619 -
Flags: review?(brian)
Updated•11 years ago
|
Attachment #8347619 -
Attachment is patch: true
Comment 2•11 years ago
|
||
Comment on attachment 8347619 [details] [diff] [review] first_patch Review of attachment 8347619 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the patch. Please make the improvements below. ::: security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c @@ +1131,5 @@ > SEC_HTTP_SERVER_SESSION session, > PRPollDesc **pPollDesc, > void *plContext) > { > + Please remove both of these blank lines. (And note trailing whitespace.) @@ +1143,5 @@ > PKIX_HTTPDEFAULTCLIENT_TYPE, > plContext), > PKIX_SESSIONNOTANHTTPDEFAULTCLIENT); > + > + PKIX_PL_HttpDefaultClient *client = (PKIX_PL_HttpDefaultClient *)session; Please remove the two lines above. Since the client variable isn't used, we should just delete it. Also, NSS is compiled in C89 mode, not C99+ mode. So, we must always declare variables at the start of a block. This code will not compile with Microsoft Visual Studio.
Attachment #8347619 -
Flags: review?(brian) → review-
Updated•10 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•9 years ago
|
Assignee: nobody → nobody
Component: Security → Libraries
Product: Core → NSS
Summary: Fix warning in /security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c → Fix unused-but-set-variable 'client' warning in pkix_pl_httpdefaultclient.c
Version: Trunk → trunk
Comment 3•9 years ago
|
||
This is Andrei's patch with Brian's comments addressed.
Attachment #8347619 -
Attachment is obsolete: true
Attachment #8581068 -
Flags: review?(emaldona)
Updated•9 years ago
|
Attachment #8581068 -
Flags: review?(emaldona) → review+
Comment 4•9 years ago
|
||
On behalf of Andrei: Thanks for the reviews!
Comment 5•9 years ago
|
||
https://hg.mozilla.org/projects/nss/rev/60c35f8c4e0f
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Updated•9 years ago
|
Keywords: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•