Closed Bug 326315 Opened 19 years ago Closed 8 years ago

Warning Reduction bug for NSS 3.11.1 + NSS 3.12

Categories

(NSS :: Build, defect, P3)

3.11

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: nelson, Assigned: nelson)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

Attachments

(1 file)

This bug is about excessive warnings in NSS source code.
This bug provides a place for any NSS developer to attach a patch that 
eliminates warnings, and get them reviewed, without having to create a 
new bug each time.  I will shortly attach the first warning reduction patch.

I propose that we'll mark this resolved/fixed when we make the 3.12 release.
I'd hope we can avoid having separate bugs for 3.11.1 and 3.12 about this.
Please review this patch using bugzilla's diff feature, because column alignment
will be correct in that view (IINM).
Attachment #211067 - Flags: review?
Comment on attachment 211067 [details] [diff] [review]
eliminate excessive warnings in two files (checked in)

Julien, please review.
Attachment #211067 - Flags: review? → review?(julien.pierre.bugs)
Comment on attachment 211067 [details] [diff] [review]
eliminate excessive warnings in two files (checked in)

Looks fine, except it appears you only changed the identation for the nss_cmsrecipientinfo_create declaration, which is unnecessary.
Attachment #211067 - Flags: review?(julien.pierre.bugs) → review+
On the NSS_3_11_BRANCH, we should only fix serious warnings
such as undeclared functions (also called implicit declarations)
and uninitialized variables.

When tracking down regressions, we often need to read diffs.
People outside our team also evaluate the risk of an NSS
upgrade by reading diffs and tend to equate risk to the size
of the diffs.  So it's important to miminize diffs.
Checked in on trunk only.

Checking in certdb/genname.c;   new revision: 1.30; previous revision: 1.29
Checking in smime/cmsrecinfo.c; new revision: 1.17; previous revision: 1.16

Leaving bug open until we ship NSS 3.12
Attachment #211067 - Attachment description: eliminate excessive warnings in two files. → eliminate excessive warnings in two files (checked in)
Priority: -- → P3
QA Contact: wtchang → build
Comment on attachment 211067 [details] [diff] [review]
eliminate excessive warnings in two files (checked in)

>-	    PL_strncasecmp(name->data, constraint->data, constraint->len))
>+	    PL_strncasecmp((char *)name->data, 
>+			   (char *)constraint->data, constraint->len))

This is wrong.

mozilla/nsprpub/lib/libc/include/plstr.h 

 258 PR_EXTERN(PRIntn)
 259 PL_strncasecmp(const char *a, const char *b, PRUint32 max);

you're casting away const for no reason. the function takes const's.

I was about to file this bug because the sun compiler doesn't appreciate the uncasted version. My patch use (const char*).

And yes, I know that C doesn't properly decorate such things, but if you're going to fix a warning, you should fix it with the safest proper cast even if the callee promises not to hurt the data, you shouldn't temporarily claim that the data is mutable.
Attachment #211067 - Flags: review-
timeless, feel free to submit a corrective patch.
Unsetting target milestone in unresolved bugs whose targets have passed.
Target Milestone: 3.12 → ---
Whiteboard: [build_warning]
Blocks: buildwarning
These NSPR warnings have since been fixed. \o/
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: