compiler: use __builtin_add_overflow_p for gcc >= 7.1.0
Compilation on Ubuntu Xenial 4.4.0-210-generic i386 with gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12) will fail with: lib/linux/compiler.h:37:34: error: implicit declaration of function ‘__builtin_add_overflow_p’ [-Werror=implicit-function-declaration] From the GCC document[1] it looks like this built-in function was only introduced since 7.1.0 This can be fixed by simply changing the version check from 5.1.0 to 7.1.0 [1] https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Integer-Overflow-Builtins.html Signed-off-by:Po-Hsu Lin <po-hsu.lin@canonical.com> Message-Id: <20210602082443.20252-1-po-hsu.lin@canonical.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Loading
Please register or sign in to comment