changeset 4754:c6f70c2457d2

Omit the special code that used __typeof__ for MIN and MAX, since we worry that it could be more trouble than it's worth.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 27 Sep 2003 22:36:10 +0000
parents 6b790c4dd07d
children 7e8a409ee684
files lib/ChangeLog lib/minmax.h
diffstat 2 files changed, 9 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,5 +1,11 @@
 2003-09-27  Paul Eggert  <eggert@twinsun.com>
 
+	* minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
+	Omit the special code that used __typeof__, since we worry that
+	it could be more trouble than it's worth.  See:
+	http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
+	http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
+
 	* free.c: New file.
 
 2003-09-26  Jim Meyering  <jim@meyering.net>
--- a/lib/minmax.h
+++ b/lib/minmax.h
@@ -27,7 +27,7 @@
    since otherwise we get redefinitions on some systems.  */
 #include <limits.h>
 
-/* Note: MIN and MAX should preferrably be used with two arguments of the
+/* Note: MIN and MAX should be used with two arguments of the
    same type.  They might not return the minimum and maximum of their two
    arguments, if the arguments have different types or have unusual
    floating-point values.  For example, on a typical host with 32-bit 'int',
@@ -42,28 +42,12 @@
 
 /* MAX(a,b) returns the maximum of A and B.  */
 #ifndef MAX
-# if __STDC__ && defined __GNUC__ && __GNUC__ >= 2
-#  define MAX(a,b) (__extension__					    \
-		     ({__typeof__ (a) _a = (a);				    \
-		       __typeof__ (b) _b = (b);				    \
-		       _a > _b ? _a : _b;				    \
-		      }))
-# else
-#  define MAX(a,b) ((a) > (b) ? (a) : (b))
-# endif
+# define MAX(a,b) ((a) > (b) ? (a) : (b))
 #endif
 
 /* MIN(a,b) returns the minimum of A and B.  */
 #ifndef MIN
-# if __STDC__ && defined __GNUC__ && __GNUC__ >= 2
-#  define MIN(a,b) (__extension__					    \
-		     ({__typeof__ (a) _a = (a);				    \
-		       __typeof__ (b) _b = (b);				    \
-		       _a < _b ? _a : _b;				    \
-		      }))
-# else
-#  define MIN(a,b) ((a) < (b) ? (a) : (b))
-# endif
+# define MIN(a,b) ((a) < (b) ? (a) : (b))
 #endif
 
 #endif /* _MINMAX_H */