[M3devel] dtoa warnings

Jay K jay.krell at cornell.edu
Sat Jan 16 21:03:07 CET 2010


A lot/all of the assignment within conditional you can see are ok because in the newer version they doubled the parens. That is the gcc convention for quashing them that unfortunately Microsoft C doesn't recognize.

 

 

C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common>cl -c -W4 -Wall -DIEEE_8087 -TC dtoa.h | more

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.


...

 

These I can fix from current source.

 

 

C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common>\cygwin\bin\gcc-4.exe -DIEEE_8087 -c -Wall dtoa.h
dtoa.h: In function 'Balloc':
dtoa.h:530: warning: suggest parentheses around assignment used as truth value
dtoa.h: In function 'mult':
dtoa.h:809: warning: suggest parentheses around assignment used as truth value
dtoa.h: In function 'pow5mult':
dtoa.h:891: warning: suggest parentheses around assignment used as truth value
dtoa.h: In function 'lshift':
dtoa.h:972: warning: suggest parentheses around assignment used as truth value
dtoa.h: In function 'd2b':
dtoa.h:1274: warning: suggest parentheses around assignment used as truth value
dtoa.h:1278: warning: suggest parentheses around assignment used as truth value
dtoa.h:1279: warning: suggest parentheses around assignment used as truth value
dtoa.h: In function 'match':
dtoa.h:1473: warning: suggest parentheses around assignment used as truth value
dtoa.h: In function 'hexnan':
dtoa.h:1505: warning: suggest parentheses around assignment used as truth value
dtoa.h:1533: warning: suggest parentheses around assignment used as truth value
dtoa.h: In function 'm3_strtod':
dtoa.h:1857: warning: suggest parentheses around assignment used as truth value
dtoa.h:1917: warning: suggest parentheses around assignment used as truth value
dtoa.h: In function 'nrv_alloc':
dtoa.h:2600: warning: suggest parentheses around assignment used as truth value
dtoa.h: In function 'm3_dtoa':
dtoa.h:2780: warning: suggest parentheses around assignment used as truth value
dtoa.h:2934: warning: suggest parentheses around assignment used as truth value
dtoa.h:3095: warning: suggest parentheses around assignment used as truth value
dtoa.h:3133: warning: suggest parentheses around assignment used as truth value


 

 - Jay

 


From: hosking at cs.purdue.edu
Date: Sat, 16 Jan 2010 13:48:49 -0500
To: jay.krell at cornell.edu
CC: m3devel at elegosoft.com
Subject: Re: [M3devel] dtoa warnings

I suggest we leave the warnings in place (remove the nowarn pragma) and vet each of them for correctness sometime.




Antony Hosking | Associate Professor | Computer Science | Purdue University
305 N. University Street | West Lafayette | IN 47907 | USA
Office  +1 765 494 6001  +1 765 494 6001  | Mobile  +1 765 427 5484  +1 765 427 5484 



On 16 Jan 2010, at 07:50, Jay K wrote:

Some of these are fixed in a newer version by adding parens.
The rest I just #pragma warning'ed away.
 
 - Jay
 


From: jay.krell at cornell.edu
To: m3devel at elegosoft.com
Date: Sat, 16 Jan 2010 11:11:28 +0000
Subject: [M3devel] dtoa warnings

Any of these worrisome?
 
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(1188) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(1190) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(1190) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(1195) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(1197) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(1274) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(1503) : warning C4245: '+=' : conversion from 'int' to 'ULong', signed/unsigned mismatch
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(1505) : warning C4245: '+=' : conversion from 'int' to 'ULong', signed/unsigned mismatch
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(1762) : warning C4127: conditional expression is constant
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(1930) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(2291) : warning C4127: conditional expression is constant
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(2319) : warning C4244: '=' : conversion from 'double' to 'ULong', possible loss of data
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(2572) : warning C4018: '<=' : signed/unsigned mismatch
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(2818) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(2819) : warning C4554: '>>' : check operator precedence for possible error; use parentheses to clarify precedence
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(2819) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(2962) : warning C4244: '=' : conversion from 'double' to 'long', possible loss of data
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(2964) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(2983) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(3026) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(3208) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(3238) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(3251) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(3257) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(3271) : warning C4244: '=' : conversion from 'int' to 'char', possible loss of data
C:\dev2\cm3.2\m3-libs\m3core\src\Csupport\Common\dtoa.h(3304) : warning C4102: 'trimzeros' : unreferenced label
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(1851) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(1911) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(2429) : warning C4701: potentially uninitialized local variable 'bd' used
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(2428) : warning C4701: potentially uninitialized local variable 'bb' used
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(2430) : warning C4701: potentially uninitialized local variable 'bs' used
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(2432) : warning C4701: potentially uninitialized local variable 'delta' used
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(524) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(819) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(833) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(885) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(890) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(894) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(912) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(915) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(966) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(1268) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(1272) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(1273) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(1282) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(1467) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(1495) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(1499) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(1527) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(2774) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(2928) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(3089) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(3127) : warning C4706: assignment within conditional expression
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(2903) : warning C4701: potentially uninitialized local variable 'ilim' used
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(2937) : warning C4701: potentially uninitialized local variable 'ilim1' used
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(3311) : warning C4701: potentially uninitialized local variable 'mlo' used
c:\dev2\cm3.2\m3-libs\m3core\src\csupport\common\dtoa.h(2594) : warning C4706: assignment within conditional expression







 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100116/18a42382/attachment-0002.html>


More information about the M3devel mailing list