This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch,testuite]: Fix bad testcase assuming int = int32_t
- From: Mike Stump <mikestump at comcast dot net>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Matthew Gretton-Dann <Matthew dot Gretton-Dann at arm dot com>
- Date: Thu, 12 Jan 2012 10:45:04 -0800
- Subject: Re: [patch,testuite]: Fix bad testcase assuming int = int32_t
- References: <4F0F0DD3.60405@gjlay.de>
On Jan 12, 2012, at 8:44 AM, Georg-Johann Lay wrote:
> Again: A test case that fails because it incorrectly assumes int is 32 bits wide.
>
> Ok to apply?
I'd think the testcase is more naturally:
> return ~((uint32_t) (arg > -3));
Does that work for you? Anyone want to weigh in on which version is better (if the second version works)? I think I have a preference for the form above.
> - return ~(arg > -3);
> + return ~((unsigned) (arg > -3));