[PATCH v1 13/35] Remove dead code due to _GL_HAVE___TYPEOF__ macro

Alejandro Colomar alx@kernel.org
Sun Nov 9 21:53:18 GMT 2025


It's unconditionally defined as 1.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
 include/intprops.h | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/include/intprops.h b/include/intprops.h
index 149513a1d0..64526a8edf 100644
--- a/include/intprops.h
+++ b/include/intprops.h
@@ -82,19 +82,11 @@
    If this is a problem for you, please let us know how to fix it for your host.
    This assumption is tested by the intprops-tests module.  */
 
-/* Does the __typeof__ keyword work?  This could be done by
-   'configure', but for now it's easier to do it by hand.  */
-# define _GL_HAVE___TYPEOF__ 1
-
-/* Return 1 if the integer type or expression T might be signed.  Return 0
-   if it is definitely unsigned.  T must not be a bit-field expression.
+/* Return 1 if the integer type or expression T is signed.  Return 0
+   if it is unsigned.  T must not be a bit-field expression.
    This macro does not evaluate its argument, and expands to an
    integer constant expression.  */
-#if _GL_HAVE___TYPEOF__
 # define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t))
-#else
-# define _GL_SIGNED_TYPE_OR_EXPR(t) 1
-#endif
 
 /* Bound on length of the string representing an unsigned integer
    value representable in B bits.  log10 (2.0) < 146/485.  The
@@ -413,21 +405,10 @@
    signed, its type is ST with bounds SMIN..SMAX; otherwise its type
    is UT with bounds U..UMAX.  ST and UT are narrower than int.
    Return 1 if the result overflows.  See above for restrictions.  */
-# if _GL_HAVE___TYPEOF__
 #  define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
     (TYPE_SIGNED (__typeof__ (*(r))) \
      ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \
      : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax))
-# else
-#  define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
-    (overflow (a, b, smin, smax) \
-     ? (overflow (a, b, 0, umax) \
-        ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \
-        : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \
-     : (overflow (a, b, 0, umax) \
-        ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \
-        : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0)))
-# endif
 
 # define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
    (sizeof *(r) == sizeof (signed char) \
-- 
2.51.0



More information about the Libc-alpha mailing list