Enable overflow detection when at least 'gcc 8' is used.

[INTERPRETER]
* BUG: Enable overflow detection when at least 'gcc 8' is used.
This commit is contained in:
Benoît Minisini 2023-01-10 17:08:16 +01:00
parent caacdd9c2f
commit b03cfc16bf

View file

@ -24,15 +24,23 @@
#ifndef __GB_OVERFLOW_H
#define __GB_OVERFLOW_H
#define DO_NOT_CHECK_OVERFLOW 1
#if __GNUC__ >= 8
#if defined __has_builtin
#if __has_builtin(__builtin_add_overflow)
#define DO_NOT_CHECK_OVERFLOW 0
#undef DO_NOT_CHECK_OVERFLOW
#define DO_NOT_CHECK_OVERFLOW 0
#else
#define DO_NOT_CHECK_OVERFLOW 1
#if defined(__has_builtin)
#if __has_builtin(__builtin_add_overflow)
#undef DO_NOT_CHECK_OVERFLOW
#define DO_NOT_CHECK_OVERFLOW 0
#endif
#endif
#endif
#endif
#endif /* __GB_OVERFLOW_H */