Closed Bug 551082 Opened 14 years ago Closed 8 years ago

quiet build warnings - casting pointers to 32bit ints and printf'ing non const pointers

Categories

(NSS :: Libraries, defect)

x86
macOS
defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Whiteboard: [build_warning])

Attachments

(1 file)

Attached patch fixesSplinter Review
so:
* 64bit pointers and 32bit integers aren't naturally compatible - hence (PRPtrdiff)
* sending a non const pointer as the second arg to fprintf scares compilers - hence "%s"
Attachment #431261 - Flags: review?(nelson)
Um, this bug is a duplicate of another.  IIRC, we WONTFIXed the other one.
What compiler, and what compiler command line options cause it to generate
these absurdly over-pedantic warnings?  Such compilers should be stomped on,
hard, until they beg for mercy or die.  Is there a command line option to 
disable these two warnings?  If so, please submit a patch to use it.

The double casts suggested here should never be necessary.
The whole point of a cast is to tell the compiler "I know what I'm doing".
Any compiler that won't take that for an answer doesn't know its place.
Comment on attachment 431261 [details] [diff] [review]
fixes

see comment 1
Attachment #431261 - Flags: review?(nelson) → review-
Whiteboard: [build_warning]
Blocks: buildwarning
WONTFIX based on comment 1 and r-'d patch.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
This might actually be FIXED, not WONTFIX.  Inspecting the current code for a few of the changes shows that the problematic casts are gone; annotate for some of the points to bug 1182667.  As for comment #1, it should perhaps not be taken as indicative of the current direction of the NSS project, given that that has recently involved enabling warnings-as-errors (aforementioned bug 1182667) as well as taking advice from even more pedantic checkers like Coverity (meta-bug 1208405).
Thanks for checking! I'm triaging ancient bug reports about compiler warnings so we can start with a clean slate. I'll upgrade this bug to FIXED if that better reflects the current code.
Depends on: 1182667
Resolution: WONTFIX → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: