]> git.ipfire.org Git - thirdparty/kmod.git/commit
shared: add helper function to add and check for overflow
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 10 Feb 2015 12:41:47 +0000 (10:41 -0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 10 Feb 2015 12:43:44 +0000 (10:43 -0200)
commitaac5f4514f71d04ac3dcb8b923209781895d7ff2
tree48292b9079a0e8989d94aa0cf0c5806b965cbdd9
parent14c3244f04002380d94903b661b93185c158077b
shared: add helper function to add and check for overflow

Use _builtin_uaddll_overflow/_builtin_uaddl_overflow when available,
abstracting the type to use it with uint64_t.

Otherwise fallback to the implementation as added in 67466f2 ("Prevent
offset + size overflow.").

This also adds the tests for this new helper in the testsuite.
configure.ac
m4/attributes.m4
shared/util.h
testsuite/test-util.c