]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(TYPE_MINIMUM): Add extra outer cast to work around
authorJim Meyering <jim@meyering.net>
Sat, 24 Jan 1998 08:45:55 +0000 (08:45 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 24 Jan 1998 08:45:55 +0000 (08:45 +0000)
bug in Cray C 5.0.3.0 when T == time_t.

src/system.h

index 48a2737cf45ecdaebaf95408825d49b901b7dfc2..53cbff08140aa7eff4978cbb0c980ee72f833162 100644 (file)
 
 /* The extra casts work around common compiler bugs.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
-#define TYPE_MINIMUM(t) (TYPE_SIGNED (t) ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0)
+/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
+   It is necessary at least when t == time_t.  */
+#define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
+                             ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
 #define TYPE_MAXIMUM(t) (~ (t) 0 - TYPE_MINIMUM (t))
 
 #ifndef INT_MAX