Open Bug 508531 Opened 10 years ago Updated 7 years ago

Fix (Windows) warnings in /pr/src/misc/prdtoa.c

Categories

(NSPR :: NSPR, defect, minor)

x86
Windows Server 2003
defect
Not set
minor

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: sgautherie, Assigned: sgautherie)

References

(Depends on 1 open bug, Blocks 1 open bug, )

Details

(Keywords: helpwanted, Whiteboard: [build_warning])

Attachments

(1 file)

Per bug 287540 comment 40.

If it's a 3rd-party file, how to forward this bug upstream?

I don't know if the warnings are c++ (not c) compiler only...

*****

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1249457826.1249467210.24422.gz&fulltext=1
WINNT 5.2 mozilla-central build on 2009/08/05 00:37:06
{
prdtoa.c(1249) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
prdtoa.c(1251) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
prdtoa.c(1251) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
prdtoa.c(1256) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
prdtoa.c(1258) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
prdtoa.c(1340) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
prdtoa.c(1986) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
prdtoa.c(2375) : warning C4244: '=' : conversion from 'double' to 'PRUint32', possible loss of data
prdtoa.c(2630) : warning C4018: '<=' : signed/unsigned mismatch
prdtoa.c(2878) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
prdtoa.c(2879) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
prdtoa.c(2879) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
prdtoa.c(3022) : warning C4244: '=' : conversion from 'double' to 'PRInt32', possible loss of data
}

*****

Fwiw,
http://office.smedbergs.us:8080/search?user=&path=%25prdtoa%25&msg=&id=1794
Compiler Warnings Tracker: mozilla-central
{
prdtoa.c:2757 - 'ilim' may be used uninitialized in this function
prdtoa.c:2757 - 'ilim1' may be used uninitialized in this function
}
See bug 287540 comment 39.
Assignee: wtc → sgautherie.bz
Status: NEW → ASSIGNED
Attachment #392696 - Flags: review?
Attachment #392696 - Flags: review? → review?(wtc)
Blocks: buildwarning
No longer blocks: 287540
Keywords: helpwanted
Fwiw, same on
http://tinderbox.mozilla.org/showlog.cgi?log=NSS/1249462661.1249475339.21274.gz&fulltext=1
trunk standard goride MINGW32_NT-5.2 32bit OPT on 2009/08/05 01:57:41
http://tinderbox.mozilla.org/showlog.cgi?log=NSS/1249459496.1249472634.22049.gz&fulltext=1
trunk standard goride MINGW32_NT-5.2 32bit DBG on 2009/08/05 01:04:56
Please note the message in bug 439144 comment 8, and note the history of 
that bug.  Note also the number of bugs filed against prdtoa that have 
been resoled WONTFIX.  The path of least resistance here might be to get
David Gay (the author of dtoa.c) to take changes or make fixes upstream.

Having said that, there is a precedent for disabling warnings for that 
file via compiler command line options in the Makefile.  I think there 
would be no objections to using that technique for this bug.
Thanks for the bug report.

To report this bug upstream:

1. Download the latest version of dtoa.c from http://www.netlib.org/fp/.

2. Compile dtoa.c with Visual C++.  See what compiler warnings there are.
(The author of dtoa.c fixed many compiler warnings earlier this year.)

3. Fix the remaining compiler warnings, and email a patch to the author
of dtoa.c (David M. Gay).  You can find his email address in the source
code.

I can add compiler pragmas to prdtoa.c to suppress these Visual C++
warnings.  See the existing compiler pragma for gcc:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/nsprpub/pr/src/misc/prdtoa.c&rev=4.7&mark=45#38

The best use of our time is to fix bug 482002, so that we will be able
to upgrade to new versions of dtoa.c more easily.
Attachment #392696 - Flags: review?(wtc) → review-
Depends on: 482002
Whiteboard: [build_warning]
You need to log in before you can comment on or make changes to this bug.