Closed Bug 15858 Opened 25 years ago Closed 25 years ago

Cleanup build warning

Categories

(NSPR :: NSPR, defect, P3)

x86
Linux
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: slamm, Assigned: wtc)

References

()

Details

http://tinderbox.mozilla.org/seamonkey/warnings.html#wtc

Here is a possible patch for a nspr warning that is blamed to you.
This skips building uxpoll.c when USE_PTHREADS is defined. Otherwise, it
builds a file that does nothing.

Index: Makefile
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/unix/Makefile,v
retrieving revision 3.21
diff -u -r3.21 Makefile
--- Makefile    1999/06/28 23:13:15     3.21
+++ Makefile    1999/10/08 19:34:41
@@ -31,8 +31,11 @@
        unix_errors.c    \
        uxproces.c \
        uxwrap.c \
-       uxpoll.c \
        $(NULL)
+
+ifneq ($(USE_PTHREADS), 1)
+CSRCS += uxpoll.c
+endif

 PTH_USER_CSRCS =          \
        pthreads_user.c \
You will also need to make the change to objs.mk,

Index: objs.mk
===================================================================
RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/unix/objs.mk,v
retrieving revision 3.20
diff -u -r3.20 objs.mk
--- objs.mk     1999/06/28 23:13:16     3.20
+++ objs.mk     1999/10/08 22:07:12
@@ -23,8 +23,11 @@
        unix_errors.c \
        uxproces.c \
        uxwrap.c \
-       uxpoll.c \
        $(NULL)
+
+ifneq ($(USE_PTHREADS), 1)
+CSRCS += uxpoll.c
+endif

 PTH_USER_CSRCS =          \
        pthreads_user.c \
Status: NEW → ASSIGNED
That's right, Steve.  Actually I am testing the exact
same patch.

I will need to wait until we land NSPR 3.5 to check in
this patch.
Ok, great. There is only one other warning for NSPR that I see on linux,

http://tinderbox.mozilla.org/seamonkey/warnings.html#larryh

That is simply an unused variable, "lock_acquired",

http://cvs-mirror.mozilla.org/webtools/bonsai/cvsblame.cgi?file=mozilla/nsprpub/pr/src/threads/prrwlock.c&mark=252#242
The fix that Steve suggested has been checked into
the main trunk of the internal cvs repository (/m/src).
I also added a #error directive to uxpoll.c to
catch accidental compilation of that file.
/m/src/ns/nspr20/pr/src/md/unix/Makefile, revision 2.32
/m/src/ns/nspr20/pr/src/md/unix/objs.mk, revision 2.27
/m/src/ns/nspr20/pr/src/md/unix/uxpoll.c, revision 2.13
The unused variable 'lock_acquired' has been removed
from prrwlock.c in the internal cvs repository (/m/src).
/m/src/ns/nspr20/pr/src/threads/prrwlock.c, revision 1.8
The warnings described above have all been fixed. However, three new ones have
popped up,

mozilla/nsprpub/pr/src/md/unix/unix.c:2986
   Suggest parentheses around comparison in operand of &
mozilla/nsprpub/pr/src/misc/prnetdb.c:991
   Unused variable `rv'
mozilla/nsprpub/pr/src/pthreads/ptio.c:1304
   Suggest parentheses around assignment used as truth value

http://tinderbox.mozilla.org/seamonkey/warnings.html#larryh
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
The new warnings in unix.c, prnetdb.c, and ptio.c have
been fixed.

(Also fixed in the internal repository /m/src.)
Status: RESOLVED → VERIFIED
Great! Marking verified.
You need to log in before you can comment on or make changes to this bug.