summaryrefslogtreecommitdiff
path: root/lib/common/perror.c
diff options
context:
space:
mode:
authorBrandon Maier <brandon.maier@rockwellcollins.com>2020-04-30 12:36:53 -0500
committerDavid Oberhollenzer <goliath@infraroot.at>2020-05-07 13:35:23 +0200
commit86d35a8273e98a0d0efd8e3b5dc9eac635c213e7 (patch)
treeef70f6e3a74721bb755e7e095152afa934abc0b7 /lib/common/perror.c
parent8734f66eacb9bbf807bbb77781c2f150f2fd3ccf (diff)
Fix compilation on GCC4 and below
When compiling with GCC4 the following error occurs. > lib/util/rbtree.c:140: undefined reference to `__builtin_uaddl_overflow' This is because __builtin_uaddl_overflow() and the other __builtin_u{add,mul}{,l,ll}_overflow() functions are only defined in GNUC < 5 for Clang. When using GCC4 and below they are not defined. Since the SZ_ADD_OV and SZ_MUL_OV are only used to check 'size_t' type values. And overflow on add and multiply of unsigned types is defined behaviour (C Standard 6.2.5 paragraph 9). It's simple to write overflow functions for this specific case. These are based on the overflow wrappers from the SEI CERT C Standard INT30-C. [1] https://gcc.gnu.org/gcc-5/changes.html Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
Diffstat (limited to 'lib/common/perror.c')
0 files changed, 0 insertions, 0 deletions