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

RESOLVED FIXED

Status

NSS
Libraries
--
trivial
RESOLVED FIXED
8 years ago
2 years ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

(Blocks: 1 bug)

trunk
x86
Mac OS X
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [build_warning])

Attachments

(1 attachment)

16.72 KB, patch
Nelson Bolyard (seldom reads bugmail)
: review-
Details | Diff | Splinter Review
(Assignee)

Description

8 years ago
Created attachment 431261 [details] [diff] [review]
fixes

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-

Updated

7 years ago
Whiteboard: [build_warning]

Updated

7 years ago
Blocks: 187528
WONTFIX based on comment 1 and r-'d patch.
Status: NEW → RESOLVED
Last Resolved: 2 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.