bind9/lib/isc/include/isc
Michał Kępień 2a2a346340 Fix cppcheck 1.89 warnings
cppcheck 1.89 enabled certain value flow analysis mechanisms [1] which
trigger null pointer dereference false positives in lib/dns/rpz.c:

    lib/dns/rpz.c:584:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1425:44: note: Calling function 'adj_trigger_cnt', 4th argument '(void*)0' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:584:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:598:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1425:44: note: Calling function 'adj_trigger_cnt', 4th argument '(void*)0' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:598:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:612:7: warning: Possible null pointer dereference: tgt_ip [nullPointer]
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^
    lib/dns/rpz.c:1425:44: note: Calling function 'adj_trigger_cnt', 4th argument '(void*)0' value is 0
      adj_trigger_cnt(rpzs, rpz_num, rpz_type, NULL, 0, true);
                                               ^
    lib/dns/rpz.c:612:7: note: Null pointer dereference
      if (KEY_IS_IPV4(tgt_prefix, tgt_ip)) {
          ^

It seems that cppcheck no longer treats at least some REQUIRE()
assertion failures as fatal, so add extra assertion macro definitions to
lib/isc/include/isc/util.h that are only used when the CPPCHECK
preprocessor macro is defined; these definitions make cppcheck 1.89
behave as expected.

There is an important requirement for these custom definitions to work:
cppcheck must properly treat abort() as a function which does not
return.  In order for that to happen, the __GNUC__ macro must be set to
a high enough number (because system include directories are used and
system headers compile attributes away if __GNUC__ is not high enough).
__GNUC__ is thus set to the major version number of the GCC compiler
used, which is what that latter does itself during compilation.

[1] aaeec462e6

(cherry picked from commit abfde3d543)
2019-10-17 10:50:51 +02:00
..
aes.h Make OpenSSL mandatory 2018-07-19 12:47:03 -04:00
app.h complete removal of a few unneeded functions 2018-10-18 09:19:12 +00:00
assertions.h Remove support for compiling without assertions (Both ISC_CHECK_ALL, ISC_CHECK_NONE are now gone) 2019-01-31 11:16:08 +01:00
atomic.h Add atomic_store_relaxed and atomic_load_relaxed macros to isc/atomic.h, fix issues in isc/stdatomic.h 2019-01-25 04:26:49 -05:00
backtrace.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
base32.h Ensure base64/base32/hex fields in DNS records that should be non-empty are. 2019-01-09 18:04:21 +11:00
base64.h Ensure base64/base32/hex fields in DNS records that should be non-empty are. 2019-01-09 18:04:21 +11:00
bind9.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
buffer.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
bufferlist.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
commandline.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
counter.h Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
crc64.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
deprecated.h Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
endian.h Revise the Windows section of <isc/endian.h> 2019-07-21 15:37:22 -04:00
errno.h Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
error.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
event.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
eventclass.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
file.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
formatcheck.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
fsaccess.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
fuzz.h Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
hash.h Remove isc_hash_reverse function 2019-07-21 15:32:57 -04:00
heap.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
hex.h Ensure base64/base32/hex fields in DNS records that should be non-empty are. 2019-01-09 18:04:21 +11:00
hmac.h remove config.h references 2018-10-30 10:42:41 -07:00
ht.h add missing DBC checks for catz and add isc_magic checks; add DBC checks to ht.c 2018-11-29 12:39:20 +11:00
httpd.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
interfaceiter.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
iterated_hash.h Add generic message digest API (isc_md) to replace specific MD functions md5/sha1/sha256 2018-10-25 08:15:42 +02:00
json.h Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
lang.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
lex.h document eol 2018-10-30 11:03:02 +11:00
lfsr.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
lib.h Remove message catalogs 2019-01-09 23:44:26 +01:00
likely.h Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
list.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
log.h Remove message catalogs 2019-01-09 23:44:26 +01:00
magic.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
Makefile.in Add reference SipHash 2-4 implementation 2019-07-21 15:32:56 -04:00
md.h remove config.h references 2018-10-30 10:42:41 -07:00
mem.h Remove isc_mem_{set,get}quota unused functions 2018-11-22 16:46:56 +01:00
meminfo.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
mutexblock.h - Make isc_mutex_destroy return void 2018-11-22 11:52:08 +00:00
netaddr.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
netscope.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
nonce.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
os.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
parseint.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
platform.h.in Drop ISC_PLATFORM_USEDECLSPEC and IRS_PLATFORM_USEDECLSPEC as they are platform dependent and only unix vs win32 platform.h header difference is enough 2018-09-07 12:17:30 +02:00
pool.h Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
portset.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
print.h Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants 2018-08-08 09:36:44 +02:00
queue.h - Make isc_mutex_destroy return void 2018-11-22 11:52:08 +00:00
quota.h refactor tcpquota and pipeline refs; allow special-case overrun in isc_quota 2019-04-25 16:20:50 +02:00
radix.h Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 12:21:53 +07:00
random.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
ratelimiter.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
refcount.h Just #define isc_refcount_increment0() to isc_refcount_increment() 2018-12-05 14:16:41 +01:00
regex.h Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
region.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
resource.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
result.h Detect partial prefixes / incomplete IPv4 address in acls. 2019-10-14 01:31:44 +11:00
resultclass.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
rwlock.h Remove isc_atomic usage from rwlock.c and stats.c 2018-08-28 12:15:39 +02:00
safe.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
serial.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
siphash.h Fix alignment issues in the native implementation of isc_siphash24() 2019-09-02 13:21:40 +02:00
sockaddr.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
socket.h implement maxudp under windows 2019-09-04 10:50:00 +10:00
stats.h Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-08 09:37:28 +02:00
stdio.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
strerr.h remove config.h references 2018-10-30 10:42:41 -07:00
string.h Replace platform ISC_PLATFORM_NEEDSTRLCPY and ISC_PLATFORM_NEEDSTRLCAT with AC_CHECK_FUNCS call 2018-09-07 12:17:30 +02:00
symtab.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
task.h - isc_task_create_bound - create a task bound to specific task queue 2018-11-23 04:34:02 -05:00
taskpool.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
timer.h complete removal of a few unneeded functions 2018-10-18 09:19:12 +00:00
tm.h Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
types.h Remove message catalogs 2019-01-09 23:44:26 +01:00
util.h Fix cppcheck 1.89 warnings 2019-10-17 10:50:51 +02:00
version.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00
xml.h Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 13:17:46 +02:00