Subject: Re: Never mind, libc *won't* build with gcc-2.7.2...
To: J.T. Conklin <jconklin@netcom.com>
From: Jonathan Stone <jonathan@dsg.stanford.edu>
List: current-users
Date: 12/18/1995 17:30:47
J.T. Conklin writes:

>It's been reported that strtoq.c compiles fine on some architectures,
>while it reports warnings on others.  I suspect this is caused by the
>fact that different definitions for QUAD_MIN and QUAD_MAX.

>The architectures where strtoq.c has been reported to compile
>(like the m68k) use gcc's "long long" constants.

	[constants elided]

>While (at least some of) the architectures where strtoq.c has been reported
>to fail to compile (like the pmax) use arithmetic expressions and casts:

	[more constants elided]

>I haven't done the math to see if these expressions do overflow or
>not, so I can't be certain if this is a gcc bug.  But it does seem like
>the easiest fix might be to change the macro definitions to use the gcc
>long long constants.

``Circumstances force me to disagree with you, Master.''
I tried the explicit manifest constants (as opposed to the
expressions) and, on a pmax, I still get an overflow warning on
line 108 of strtoq.c.

using cc -I shows that the offending line expands to

        cutoff = neg ? -(u_quad_t)(-0x7fffffffffffffffLL-1)  : 0x7ffffffffffffff
fLL ;

for which giving an overflow warning seems entirely reasonable --
though I, too, have not done the math.