This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for gcc.c-torture/execute/ieee/20010226-1.c


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]