This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: problem for 16 bit 'int' types.
- To: Richard Henderson <rth at redhat dot com>
- Subject: Re: PATCH: problem for 16 bit 'int' types.
- From: Alan Lehotsky <lehotsky at tiac dot net>
- Date: Tue, 9 Jan 2001 20:00:11 -0500
- Cc: lehotsky at tiac dot net, gcc-patches at gcc dot gnu dot org, alehotsky at cygnus dot com
- References: <200101091436.JAA08921@iron.> <20010109110104.E4132@redhat.com>
At 11:01 -0800 1/9/01, Richard Henderson wrote:
>On Tue, Jan 09, 2001 at 09:36:15AM -0500, lehotsky@tiac.net wrote:
>> - return b>=0x80000001;
>> + return b>= (INT_MIN+1);
>[...]
>> - return b>=0xffffffff;
>> + return b>=-1;
>
>Not ok. You've changed the nature of the test.
>
>These two hex constants are of type "unsigned int" with a
>32-bit int in C89, and either "long" or "unsigned long" in
>C99 (depending on the width of the target's long).
>
>Using ((unsigned)INT_MAX + 2) and UINT_MAX should be ok.
>
Thanks for catching that. I actually looked to see what the C89
standard said
but misread the specifics. I made the suggested modification and
recompiled
the test on Solaris to confirm that it still passes. Amusingly enough
it now fails on my port in 5 of the 6 executable versions - so it
was a good
catch!
>
>r~
--
------------------------------------------------------------------------
Quality Software Management
http://www.tiac.net/users/qsmgmt
apl@alum.mit.edu
(978)287-0435 Voice
(978)808-6836 Cell
(978)287-0436 Fax
Software Process Improvement and Management Consulting
Language Design and Compiler Implementation