mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
factor: add platform sanity check
* src/factor.c: Check against theoretical platform.
This commit is contained in:
1 parent
8ff11d626b
commit
397d9b02a3
1 file changed
+6
@@ -134,6 +134,12 @@ typedef intmax_t wide_int;
|
||||
#endif
|
||||
#define WIDE_UINT_MAX ((wide_uint) -1)
|
||||
|
||||
/* Check that we are not on a theoretical (but allowed by
|
||||
POSIX) platform where WIDE_UINT_MAX <= INT_MAX.
|
||||
This could result in undefined behavior due to signed integer
|
||||
overflow if a word promotes to int. */
|
||||
static_assert (INT_MAX < WIDE_UINT_MAX);
|
||||
|
||||
#ifndef USE_LONGLONG_H
|
||||
/* With the way we use longlong.h, it's only safe to use
|
||||
when UWtype = UHWtype, as there were various cases
|
||||
|
||||
Reference in new issue
Block a user