Closed Bug 1318979 Opened 3 years ago Closed 3 years ago
Suppress some unused variable build warnings
NSPR builds (on my machine at least) warn about unused variables in a few places. The first set is in ptio.c where the interaction of various #ifdef statements is a little off. The second is in xxvrsion.c where we use a dummy variable to pull in string symbols.
Assignee: nobody → martin.thomson
Attachment #8812632 - Flags: review?(ted)
Comment on attachment 8812633 [details] [diff] [review] nspr-3.patch Review of attachment 8812633 [details] [diff] [review]: ----------------------------------------------------------------- ::: lib/ds/plvrsion.c @@ +98,2 @@ > > /* plvrsion.c */ Oh, this is sad. plvrsion.c only differs by the name that it uses: prVersionDescription_libplds vs. prVersionDescription_libprstrms vs. prVersionDescription_libplc. It seems like we could use a #include and save some typing. prvrsion.c is ever so slightly different again, but not enough to justify an entire .c file.
I'm surprised how long I had to stare at these patches to conclude they make sense.
Comment on attachment 8812632 [details] [diff] [review] nspr-2.patch r=kaie The existing code only uses md_af ifdef _PR_HAVE_SOCKADDR_LEN, so it makes sense to only define the variable in that case.
Attachment #8812632 - Flags: review?(kaie) → review+
Comment on attachment 8812633 [details] [diff] [review] nspr-3.patch r=kaie You check if the warning triggers a failure, and if it does, you check if the failure can be suppressed by using a pragma to ignore the parameter, and if yes, you define _PR_HAS_PRAGMA_DIAGNOSTIC=1. Clever.
Attachment #8812633 - Flags: review?(kaie) → review+
Please let me know if you don't want to checkin yourself.
I did all the usual things for checkin, I hope that the rules are the same for NSPR as NSS. remote: https://hg.mozilla.org/projects/nspr/rev/8319f7a459dc64fd6d62e24381d114b460e9fb9d remote: https://hg.mozilla.org/projects/nspr/rev/0835554ac65ebbf1875c37454f34f315fbb514a6
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Version: other → 4.14
You need to log in before you can comment on or make changes to this bug.