This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for gcc.c-torture/execute/ieee/20010226-1.c
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- To: "D.Venkatasubramanian, Noida" <dvenkat at noida dot hcltech dot com>
- Cc: gcc-patches at gcc dot gnu dot org, "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: Mon, 23 Sep 2002 23:48:53 +1000
- Subject: Re: Patch for gcc.c-torture/execute/ieee/20010226-1.c
- References: <E04CF3F88ACBD5119EFE00508BBB21210489C66E@exch-01.noida.hcltech.com>
On 23-Sep-2002, D.Venkatasubramanian, Noida <dvenkat@noida.hcltech.com> wrote:
> >> You are assuming 8-bit bytes here.
>
> So, could we do something like this?
>
> + #if defined (__H8300__) || (__H8300H__) || (__H8300S__)
> + if (sizeof(long double) <= 4)
> + exit (0);
> + #endif
I guess that would work.
But it would be easy enough to make it work on any system with 8-bit bytes:
if (sizeof(long double) <= 4 && ((unsigned char)-1) == 255)
exit (0);
The following is an even more general alternative:
#include <limits.h>
...
if (sizeof(long double) * CHAR_BIT <= 32)
exit (0);
But I don't know whether or not it is OK to include limits.h here.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.