intprops-internal.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. /* intprops-internal.h -- properties of integer types not visible to users
  2. Copyright (C) 2001-2026 Free Software Foundation, Inc.
  3. This program is free software: you can redistribute it and/or modify it
  4. under the terms of the GNU Lesser General Public License as published
  5. by the Free Software Foundation; either version 2.1 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  13. #ifndef _GL_INTPROPS_INTERNAL_H
  14. #define _GL_INTPROPS_INTERNAL_H
  15. #include <limits.h>
  16. /* Pacify GCC 13.2 in some calls to _GL_EXPR_SIGNED. */
  17. #if 4 < __GNUC__ + (3 <= __GNUC_MINOR__) && !defined __clang__
  18. # pragma GCC diagnostic ignored "-Wtype-limits"
  19. #endif
  20. /* Return a value with the common real type of E and V and the value of V.
  21. Do not evaluate E. */
  22. #define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
  23. /* The extra casts in the following macros work around compiler bugs,
  24. e.g., in Cray C 5.0.3.0. */
  25. /* True if the real type T is signed. */
  26. #define _GL_TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
  27. /* Return 1 if the real expression E, after promotion, has a
  28. signed or floating type. Do not evaluate E. */
  29. #define _GL_EXPR_SIGNED(e) (_GL_INT_CONVERT (e, -1) < 0)
  30. /* Minimum and maximum values for integer types and expressions. */
  31. /* The width in bits of the integer type or expression T.
  32. Do not evaluate T. T must not be a bit-field expression.
  33. Padding bits are not supported; this is checked at compile-time below. */
  34. #define _GL_TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
  35. /* The maximum and minimum values for the type of the expression E,
  36. after integer promotion. E is not evaluated. */
  37. #define _GL_INT_MINIMUM(e) \
  38. (_GL_EXPR_SIGNED (e) \
  39. ? ~ _GL_SIGNED_INT_MAXIMUM (e) \
  40. : _GL_INT_CONVERT (e, 0))
  41. #define _GL_INT_MAXIMUM(e) \
  42. (_GL_EXPR_SIGNED (e) \
  43. ? _GL_SIGNED_INT_MAXIMUM (e) \
  44. : _GL_INT_CONVERT (e, -1))
  45. #define _GL_SIGNED_INT_MAXIMUM(e) \
  46. (((_GL_INT_CONVERT (e, 1) << (_GL_TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1)
  47. /* Work around OpenVMS incompatibility with C99. */
  48. #if !defined LLONG_MAX && defined __INT64_MAX
  49. # define LLONG_MAX __INT64_MAX
  50. # define LLONG_MIN __INT64_MIN
  51. #endif
  52. /* This include file assumes that signed types are two's complement without
  53. padding bits; the above macros have undefined behavior otherwise.
  54. If this is a problem for you, please let us know how to fix it for your host.
  55. This assumption is tested by the intprops-tests module. */
  56. /* Does the __typeof__ keyword work? This could be done by
  57. 'configure', but for now it's easier to do it by hand. */
  58. #if ((defined __GNUC__ && 2 <= __GNUC__) \
  59. || (defined __clang_major__ && 4 <= __clang_major__) \
  60. || (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
  61. || (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \
  62. || (defined _MSC_VER && 1939 <= _MSC_VER))
  63. # define _GL_HAVE___TYPEOF__ 1
  64. #else
  65. # define _GL_HAVE___TYPEOF__ 0
  66. #endif
  67. /* Return 1 if the integer type or expression T might be signed. Return 0
  68. if it is definitely unsigned. T must not be a bit-field expression.
  69. This macro does not evaluate its argument, and expands to an
  70. integer constant expression. */
  71. #if _GL_HAVE___TYPEOF__
  72. # define _GL_SIGNED_TYPE_OR_EXPR(t) _GL_TYPE_SIGNED (__typeof__ (t))
  73. #else
  74. # define _GL_SIGNED_TYPE_OR_EXPR(t) 1
  75. #endif
  76. /* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
  77. A should not have side effects, and A's type should be an
  78. integer with minimum value MIN and maximum MAX. */
  79. #define _GL_INT_NEGATE_RANGE_OVERFLOW(a, min, max) \
  80. ((min) < 0 ? (a) < - (max) : 0 < (a))
  81. /* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
  82. (A, B, P) work when P is non-null. */
  83. #ifdef __EDG__
  84. /* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned
  85. <https://bugs.gnu.org/53256>. */
  86. # define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
  87. #elif defined __has_builtin
  88. # define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
  89. /* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
  90. see <https://gcc.gnu.org/PR98269>. */
  91. #elif 7 <= __GNUC__
  92. # define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
  93. #else
  94. # define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
  95. #endif
  96. /* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */
  97. #if defined __clang_major__ && __clang_major__ < 14
  98. /* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */
  99. # define _GL_HAS_BUILTIN_MUL_OVERFLOW 0
  100. #else
  101. # define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW
  102. #endif
  103. /* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
  104. __builtin_sub_overflow_p and __builtin_mul_overflow_p. */
  105. #ifdef __EDG__
  106. /* In EDG-based compilers like ICC 2021.3 and earlier,
  107. __builtin_add_overflow_p etc. are not treated as integral constant
  108. expressions even when all arguments are. */
  109. # define _GL_HAS_BUILTIN_OVERFLOW_P 0
  110. #elif defined __has_builtin
  111. # define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p)
  112. #else
  113. # define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
  114. #endif
  115. #if (!defined _GL_STDCKDINT_H && 202311 <= __STDC_VERSION__ \
  116. && ! (_GL_HAS_BUILTIN_ADD_OVERFLOW && _GL_HAS_BUILTIN_MUL_OVERFLOW))
  117. # include <stdckdint.h>
  118. #endif
  119. /* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
  120. Return 1 if the result overflows. Arguments should not have side
  121. effects and A, B and *R can be of any integer type other than char,
  122. bool, a bit-precise integer type, or an enumeration type. */
  123. #if _GL_HAS_BUILTIN_ADD_OVERFLOW
  124. # define _GL_INT_ADD_WRAPV(a, b, r) __builtin_add_overflow (a, b, r)
  125. # define _GL_INT_SUBTRACT_WRAPV(a, b, r) __builtin_sub_overflow (a, b, r)
  126. #elif defined ckd_add && defined ckd_sub && !defined _GL_STDCKDINT_H
  127. # define _GL_INT_ADD_WRAPV(a, b, r) ckd_add (r, + (a), + (b))
  128. # define _GL_INT_SUBTRACT_WRAPV(a, b, r) ckd_sub (r, + (a), + (b))
  129. #else
  130. # define _GL_INT_ADD_WRAPV(a, b, r) \
  131. _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)
  132. # define _GL_INT_SUBTRACT_WRAPV(a, b, r) \
  133. _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
  134. #endif
  135. #if _GL_HAS_BUILTIN_MUL_OVERFLOW
  136. # if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
  137. || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
  138. && !defined __clang__ && !defined __EDG__)
  139. # define _GL_INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
  140. # else
  141. /* Work around GCC bug 91450. */
  142. # define _GL_INT_MULTIPLY_WRAPV(a, b, r) \
  143. ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && _GL_EXPR_SIGNED (a) && _GL_EXPR_SIGNED (b) \
  144. && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, \
  145. (__typeof__ (*(r))) 0, \
  146. (__typeof__ (*(r))) -1)) \
  147. ? ((void) __builtin_mul_overflow (a, b, r), 1) \
  148. : __builtin_mul_overflow (a, b, r))
  149. # endif
  150. #elif defined ckd_mul && !defined _GL_STDCKDINT_H
  151. # define _GL_INT_MULTIPLY_WRAPV(a, b, r) ckd_mul (r, + (a), + (b))
  152. #else
  153. # define _GL_INT_MULTIPLY_WRAPV(a, b, r) \
  154. _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
  155. #endif
  156. /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
  157. https://gcc.gnu.org/PR68193
  158. https://llvm.org/bugs/show_bug.cgi?id=25390
  159. For now, assume GCC < 14 and all Clang versions generate bogus
  160. warnings for _Generic. This matters only for compilers that
  161. lack relevant builtins. */
  162. #if (__GNUC__ && __GNUC__ < 14) || defined __clang__
  163. # define _GL__GENERIC_BOGUS 1
  164. #else
  165. # define _GL__GENERIC_BOGUS 0
  166. #endif
  167. /* Store the low-order bits of A <op> B into *R, where OP specifies
  168. the operation and OVERFLOW the overflow predicate. Return 1 if the
  169. result overflows. Arguments should not have side effects,
  170. and A, B and *R can be of any integer type other than char, bool, a
  171. bit-precise integer type, or an enumeration type. */
  172. #if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
  173. # define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
  174. (_Generic \
  175. (*(r), \
  176. signed char: \
  177. _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
  178. signed char, SCHAR_MIN, SCHAR_MAX), \
  179. unsigned char: \
  180. _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
  181. unsigned char, 0, UCHAR_MAX), \
  182. short int: \
  183. _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
  184. short int, SHRT_MIN, SHRT_MAX), \
  185. unsigned short int: \
  186. _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
  187. unsigned short int, 0, USHRT_MAX), \
  188. int: \
  189. _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
  190. int, INT_MIN, INT_MAX), \
  191. unsigned int: \
  192. _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
  193. unsigned int, 0, UINT_MAX), \
  194. long int: \
  195. _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
  196. long int, LONG_MIN, LONG_MAX), \
  197. unsigned long int: \
  198. _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
  199. unsigned long int, 0, ULONG_MAX), \
  200. long long int: \
  201. _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
  202. long long int, LLONG_MIN, LLONG_MAX), \
  203. unsigned long long int: \
  204. _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
  205. unsigned long long int, 0, ULLONG_MAX)))
  206. #else
  207. /* Store the low-order bits of A <op> B into *R, where OP specifies
  208. the operation and OVERFLOW the overflow predicate. If *R is
  209. signed, its type is ST with bounds SMIN..SMAX; otherwise its type
  210. is UT with bounds U..UMAX. ST and UT are narrower than int.
  211. Return 1 if the result overflows. Arguments should not have side
  212. effects, and A, B and *R can be of any integer type other than
  213. char, bool, a bit-precise integer type, or an enumeration type. */
  214. # if _GL_HAVE___TYPEOF__
  215. # define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
  216. (_GL_TYPE_SIGNED (__typeof__ (*(r))) \
  217. ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \
  218. : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax))
  219. # else
  220. # define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
  221. (overflow (a, b, smin, smax) \
  222. ? (overflow (a, b, 0, umax) \
  223. ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \
  224. : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \
  225. : (overflow (a, b, 0, umax) \
  226. ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \
  227. : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0)))
  228. # endif
  229. # define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
  230. (sizeof *(r) == sizeof (signed char) \
  231. ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
  232. signed char, SCHAR_MIN, SCHAR_MAX, \
  233. unsigned char, UCHAR_MAX) \
  234. : sizeof *(r) == sizeof (short int) \
  235. ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
  236. short int, SHRT_MIN, SHRT_MAX, \
  237. unsigned short int, USHRT_MAX) \
  238. : sizeof *(r) == sizeof (int) \
  239. ? (_GL_EXPR_SIGNED (*(r)) \
  240. ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
  241. int, INT_MIN, INT_MAX) \
  242. : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
  243. unsigned int, 0, UINT_MAX)) \
  244. : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
  245. # ifdef LLONG_MAX
  246. # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
  247. (sizeof *(r) == sizeof (long int) \
  248. ? (_GL_EXPR_SIGNED (*(r)) \
  249. ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
  250. long int, LONG_MIN, LONG_MAX) \
  251. : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
  252. unsigned long int, 0, ULONG_MAX)) \
  253. : (_GL_EXPR_SIGNED (*(r)) \
  254. ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
  255. long long int, LLONG_MIN, LLONG_MAX) \
  256. : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
  257. unsigned long long int, 0, ULLONG_MAX)))
  258. # else
  259. # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
  260. (_GL_EXPR_SIGNED (*(r)) \
  261. ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
  262. long int, LONG_MIN, LONG_MAX) \
  263. : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
  264. unsigned long int, 0, ULONG_MAX))
  265. # endif
  266. #endif
  267. /* Store the low-order bits of A <op> B into *R, where the operation
  268. is given by OP. Use the unsigned type UT for calculation to avoid
  269. overflow problems. *R's type is T, with extrema TMIN and TMAX.
  270. T can be any signed integer type other than char, bool, a
  271. bit-precise integer type, or an enumeration type.
  272. Return 1 if the result overflows. */
  273. #define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
  274. (overflow (a, b, tmin, tmax) \
  275. ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \
  276. : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0))
  277. /* Return 1 if the integer expressions A - B and -A would overflow,
  278. respectively. Arguments should not have side effects,
  279. and can be any signed integer type other than char, bool, a
  280. bit-precise integer type, or an enumeration type.
  281. These macros are tuned for their last input argument being a constant. */
  282. #if _GL_HAS_BUILTIN_OVERFLOW_P
  283. # define _GL_INT_NEGATE_OVERFLOW(a) \
  284. __builtin_sub_overflow_p (0, a, (__typeof__ (- (a))) 0)
  285. #else
  286. # define _GL_INT_NEGATE_OVERFLOW(a) \
  287. _GL_INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
  288. #endif
  289. /* Return the low-order bits of A <op> B, where the operation is given
  290. by OP. Use the unsigned type UT for calculation to avoid undefined
  291. behavior on signed integer overflow, and convert the result to type T.
  292. UT is at least as wide as T and is no narrower than unsigned int,
  293. T is two's complement, and there is no padding or trap representations.
  294. Assume that converting UT to T yields the low-order bits, as is
  295. done in all known two's-complement C compilers. E.g., see:
  296. https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html
  297. According to the C standard, converting UT to T yields an
  298. implementation-defined result or signal for values outside T's
  299. range. However, code that works around this theoretical problem
  300. runs afoul of a compiler bug in Oracle Studio 12.3 x86. See:
  301. https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html
  302. As the compiler bug is real, don't try to work around the
  303. theoretical problem. */
  304. #define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \
  305. ((t) ((ut) (a) op (ut) (b)))
  306. /* Return true if the numeric values A + B, A - B, A * B fall outside
  307. the range TMIN..TMAX. Arguments should not have side effects
  308. and can be any integer type other than char, bool,
  309. a bit-precise integer type, or an enumeration type.
  310. TMIN should be signed and nonpositive.
  311. TMAX should be positive, and should be signed unless TMIN is zero. */
  312. #define _GL_INT_ADD_RANGE_OVERFLOW(a, b, tmin, tmax) \
  313. ((b) < 0 \
  314. ? (((tmin) \
  315. ? ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (a, (tmin) - (b))) || (b) < (tmin)) \
  316. && (a) < (tmin) - (b)) \
  317. : (a) <= -1 - (b)) \
  318. || ((_GL_EXPR_SIGNED (a) ? 0 <= (a) : (tmax) < (a)) && (tmax) < (a) + (b))) \
  319. : (a) < 0 \
  320. ? (((tmin) \
  321. ? ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (b, (tmin) - (a))) || (a) < (tmin)) \
  322. && (b) < (tmin) - (a)) \
  323. : (b) <= -1 - (a)) \
  324. || ((_GL_EXPR_SIGNED (_GL_INT_CONVERT (a, b)) || (tmax) < (b)) \
  325. && (tmax) < (a) + (b))) \
  326. : (tmax) < (b) || (tmax) - (b) < (a))
  327. #define _GL_INT_SUBTRACT_RANGE_OVERFLOW(a, b, tmin, tmax) \
  328. (((a) < 0) == ((b) < 0) \
  329. ? ((a) < (b) \
  330. ? !(tmin) || -1 - (tmin) < (b) - (a) - 1 \
  331. : (tmax) < (a) - (b)) \
  332. : (a) < 0 \
  333. ? ((!_GL_EXPR_SIGNED (_GL_INT_CONVERT ((a) - (tmin), b)) && (a) - (tmin) < 0) \
  334. || (a) - (tmin) < (b)) \
  335. : ((! (_GL_EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
  336. && _GL_EXPR_SIGNED (_GL_INT_CONVERT ((tmax) + (b), a))) \
  337. && (tmax) <= -1 - (b)) \
  338. || (tmax) + (b) < (a)))
  339. #define _GL_INT_MULTIPLY_RANGE_OVERFLOW(a, b, tmin, tmax) \
  340. ((b) < 0 \
  341. ? ((a) < 0 \
  342. ? (_GL_EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
  343. ? (a) < (tmax) / (b) \
  344. : ((_GL_INT_NEGATE_OVERFLOW (b) \
  345. ? _GL_INT_CONVERT (b, tmax) >> (_GL_TYPE_WIDTH (+ (b)) - 1) \
  346. : (tmax) / -(b)) \
  347. <= -1 - (a))) \
  348. : _GL_INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \
  349. ? (_GL_EXPR_SIGNED (a) \
  350. ? 0 < (a) + (tmin) \
  351. : 0 < (a) && -1 - (tmin) < (a) - 1) \
  352. : (tmin) / (b) < (a)) \
  353. : (b) == 0 \
  354. ? 0 \
  355. : ((a) < 0 \
  356. ? (_GL_INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (a, tmin)) && (a) == -1 \
  357. ? (_GL_EXPR_SIGNED (b) ? 0 < (b) + (tmin) : -1 - (tmin) < (b) - 1) \
  358. : (tmin) / (a) < (b)) \
  359. : (tmax) / (b) < (a)))
  360. #endif /* _GL_INTPROPS_INTERNAL_H */