Files
bind9/lib/dns
Michał Kępień be38f0c33a Fix cppcheck 1.90 warnings
cppcheck 1.90 reports the following false positives for
lib/dns/tests/rbt_serialize_test.c:

    lib/dns/tests/rbt_serialize_test.c:412:12: warning: Either the condition 'base!=NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
      p = base + (r % filesize);
               ^
    lib/dns/tests/rbt_serialize_test.c:407:20: note: Assuming that condition 'base!=NULL' is not redundant
      assert_true(base != NULL && base != MAP_FAILED);
                       ^
    lib/dns/tests/rbt_serialize_test.c:405:14: note: Assignment 'base=mmap(NULL,filesize,PROT_READ|PROT_WRITE,0|MAP_PRIVATE,fd,0)', assigned value is 0
      base = mmap(NULL, filesize, PROT_READ|PROT_WRITE,
                 ^
    lib/dns/tests/rbt_serialize_test.c:412:12: note: Null pointer addition
      p = base + (r % filesize);
               ^
    lib/dns/tests/rbt_serialize_test.c:413:12: warning: Either the condition 'base!=NULL' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
      q = base + filesize;
               ^
    lib/dns/tests/rbt_serialize_test.c:407:20: note: Assuming that condition 'base!=NULL' is not redundant
      assert_true(base != NULL && base != MAP_FAILED);
                       ^
    lib/dns/tests/rbt_serialize_test.c:405:14: note: Assignment 'base=mmap(NULL,filesize,PROT_READ|PROT_WRITE,0|MAP_PRIVATE,fd,0)', assigned value is 0
      base = mmap(NULL, filesize, PROT_READ|PROT_WRITE,
                 ^
    lib/dns/tests/rbt_serialize_test.c:413:12: note: Null pointer addition
      q = base + filesize;
               ^

This is caused by cppcheck not understanding how cmocka's assert_true()
macro works.  The problem being reported is a false positive: if mmap()
fails, the lines flagged by cppcheck will never be reached.  Address the
problem by suppressing nullPointerArithmeticRedundantCheck warnings for
the affected lines.
2020-03-04 12:41:01 +01:00
..
2020-02-24 22:04:43 -08:00
2020-03-04 12:41:01 +01:00
2020-02-24 22:04:43 -08:00
2020-02-12 15:37:33 +00:00
2019-03-14 13:53:04 -07:00
2020-03-04 12:41:01 +01:00
2018-08-10 15:20:58 +02:00
2020-02-24 22:04:43 -08:00
2020-02-24 22:04:43 -08:00
2019-12-23 08:20:59 +11:00
2020-01-13 15:06:35 +01:00
2019-02-19 10:26:00 +11:00
2019-10-04 14:34:21 +10:00
2019-09-12 19:31:56 +10:00
2018-11-15 00:16:35 +00:00
2020-02-21 14:09:59 -08:00
2020-02-24 22:04:43 -08:00
2019-08-29 20:05:22 -07:00
2020-02-21 14:09:59 -08:00
2019-08-28 16:26:24 +10:00
2019-03-14 09:01:31 +11:00
2019-02-19 09:38:09 +11:00
2018-08-10 15:20:58 +02:00
2019-11-05 23:07:07 +01:00