Patch for gcc.c-torture/execute/ieee/20010226-1.c
Fergus Henderson
fjh@cs.mu.OZ.AU
Mon Sep 23 06:49:00 GMT 2002
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.
More information about the Gcc-patches
mailing list