diff options
Diffstat (limited to 'support/intprops.h')
-rw-r--r-- | support/intprops.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/support/intprops.h b/support/intprops.h index 7f20f09f..d4a917f7 100644 --- a/support/intprops.h +++ b/support/intprops.h @@ -1,6 +1,6 @@ /* intprops.h -- properties of integer types - Copyright (C) 2001-2021 Free Software Foundation, Inc. + Copyright (C) 2001-2022 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published @@ -229,18 +229,22 @@ /* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow (A, B, P) work when P is non-null. */ -#if defined __has_builtin +#ifdef __EDG__ +/* EDG-based compilers like nvc 22.1 cannot add 64-bit signed to unsigned + <https://bugs.gnu.org/53256>. */ +# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0 +#elif defined __has_builtin # define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow) /* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>. */ -#elif 7 <= __GNUC__ && !defined __EDG__ +#elif 7 <= __GNUC__ # define _GL_HAS_BUILTIN_ADD_OVERFLOW 1 #else # define _GL_HAS_BUILTIN_ADD_OVERFLOW 0 #endif /* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */ -#if defined __clang_major_ && __clang_major__ < 14 +#if defined __clang_major__ && __clang_major__ < 14 /* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */ # define _GL_HAS_BUILTIN_MUL_OVERFLOW 0 #else |