Open
Bug 302152
Opened 19 years ago
Updated 2 years ago
Lots and lots of compiler warnings fixed
Categories
(NSPR :: NSPR, defect)
Tracking
(Not tracked)
REOPENED
People
(Reporter: mi+mozilla, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [build_warning])
Attachments
(3 files)
1.94 KB,
patch
|
Details | Diff | Splinter Review | |
27.37 KB,
patch
|
Details | Diff | Splinter Review | |
61.92 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.4; FreeBSD; X11; amd64) KHTML/3.4.1 (like Gecko)
Build Identifier:
Compiling with ``-Wall -Wno-parentheses'' raises and awful lot of warnings
(especially on amd64), which makes searching for genuine problems very
difficult.
Most of the problems fall into one of the following categories:
1. mismatch between arguments and format string of printf functions. The main
culprits are using various integer formats to print pointers (instead of simple
%p) and using long-specifiers (%ld) for 32-bit values. On both 32-bit and
64-bit int is usually a 32-bit value, so simply removing the 'l' seems enough.
To be absolutely safe, of course, one should use %ld and cast each variable to
long. My patch does not do that.
2. Casting pointers to integers of different (smaller) size. My patch casts to
intptr_t first -- I examined all such code and found no cases, where actual
loss of bits were possible.
3. Unused vairables, static functions -- removed or ifdef-ed out.
Having spent much time in this code, I must complain, that it overuses NSPR's
own types (such as PRInt32). In simple cases -- when no assumptions need to be
made regarding sizeof -- standard C types (such as int) should be used. The
patch for lib/tests/string.c is particularly large because of this habit, for
example.
Reproducible: Always
Reporter | ||
Comment 1•19 years ago
|
||
Reporter | ||
Comment 2•19 years ago
|
||
Reporter | ||
Comment 3•19 years ago
|
||
The last patch in this file is for the runtests.sh script itself. It changes
the script to show the output of the failed tests to stdout for the purposes of
external testing (such as by FreeBSD port).
Please, consider the diffs for the .c files first...
Reporter | ||
Comment 4•19 years ago
|
||
BTW, is there a "test harness" somewhere for the lib/tests? The string and
base64t both seem to do something meaningful by themselves, but arena requires
command line arguments... Can you give me a reasonable example of such? Thanks!
Updated•18 years ago
|
QA Contact: wtchang → nspr
Updated•14 years ago
|
Whiteboard: [build_warning]
Updated•14 years ago
|
Blocks: buildwarning
Comment 5•9 years ago
|
||
These NSPR patches from 2005 are no longer relevant. NSPR warnings should be fixed upstream.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
Reporter | ||
Comment 7•9 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #5)
> These NSPR patches from 2005 are no longer relevant.
Unfortunately, NSPR still generates TONNES of compiler-warnings today, 10 years later... Here are the up-to-date patches as used by the FreeBSD port. The patches aren't FreeBSD-specific and ought to be merged into release:
https://svnweb.freebsd.org/ports/head/devel/nspr/files/patch-warnings?view=log
https://svnweb.freebsd.org/ports/head/devel/nspr/files/patch-tests?view=log
https://svnweb.freebsd.org/ports/head/devel/nspr/files/patch-libtests?view=log
> NSPR warnings should be fixed upstream.
What is "upstream" here? Is NSPR no longer a Mozilla product?
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INCOMPLETE → ---
Reporter | ||
Comment 8•9 years ago
|
||
(In reply to Chris Peterson [:cpeterson] from comment #7 to Bug 301985)
> NSPR and NSS are maintained in a CVS repo shared by some non-Mozilla
> projects, independent of Firefox code.
But they still use bugzilla.mozilla.org for issue-tracking, do they not?
Updated•2 years ago
|
Severity: normal → S3
Comment 9•2 years ago
|
||
The bug assignee is inactive on Bugzilla, so the assignee is being reset.
Assignee: wtc → nobody
You need to log in
before you can comment on or make changes to this bug.
Description
•