bind9/lib/isc
Michał Kępień eeec8e8d83 Address GCC 9.1 -O3 compilation warnings
Compiling with -O3 triggers the following warnings with GCC 9.1:

    task.c: In function ‘isc__taskmgr_create’:
    task.c:1456:44: warning: ‘%04u’ directive output may be truncated writing between 4 and 10 bytes into a region of size 6 [-Wformat-truncation=]
     1456 |    snprintf(name, sizeof(name), "isc-worker%04u", i);
          |                                            ^~~~
    task.c:1456:33: note: directive argument in the range [0, 4294967294]
     1456 |    snprintf(name, sizeof(name), "isc-worker%04u", i);
          |                                 ^~~~~~~~~~~~~~~~
    task.c:1456:4: note: ‘snprintf’ output between 15 and 21 bytes into a destination of size 16
     1456 |    snprintf(name, sizeof(name), "isc-worker%04u", i);
          |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    rrl.c: In function ‘debit_rrl_entry’:
    rrl.c:602:35: error: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 9 [-Werror=format-truncation=]
      602 |   snprintf(buf, sizeof(buf), "age=%d", age);
          |                                   ^~
    rrl.c:602:30: note: directive argument in the range [0, 2147483647]
      602 |   snprintf(buf, sizeof(buf), "age=%d", age);
          |                              ^~~~~~~~
    rrl.c:602:3: note: ‘snprintf’ output between 6 and 15 bytes into a destination of size 13
      602 |   snprintf(buf, sizeof(buf), "age=%d", age);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    rrl.c:602:35: error: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 9 [-Werror=format-truncation=]
      602 |   snprintf(buf, sizeof(buf), "age=%d", age);
          |                                   ^~
    rrl.c:602:30: note: directive argument in the range [0, 2147483647]
      602 |   snprintf(buf, sizeof(buf), "age=%d", age);
          |                              ^~~~~~~~
    rrl.c:602:3: note: ‘snprintf’ output between 6 and 15 bytes into a destination of size 13
      602 |   snprintf(buf, sizeof(buf), "age=%d", age);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    rrl.c:602:35: error: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 9 [-Werror=format-truncation=]
      602 |   snprintf(buf, sizeof(buf), "age=%d", age);
          |                                   ^~
    rrl.c:602:30: note: directive argument in the range [0, 2147483647]
      602 |   snprintf(buf, sizeof(buf), "age=%d", age);
          |                              ^~~~~~~~
    rrl.c:602:3: note: ‘snprintf’ output between 6 and 15 bytes into a destination of size 13
      602 |   snprintf(buf, sizeof(buf), "age=%d", age);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    private_test.c: In function ‘private_nsec3_totext_test’:
    private_test.c:114:9: warning: array subscript 4 is outside array bounds of ‘uint32_t[1]’ {aka ‘unsigned int[1]’} [-Warray-bounds]
      114 |  while (*sp == '\0' && slen > 0) {
          |         ^~~
    private_test.c:107:11: note: while referencing ‘salt’
      107 |  uint32_t salt;
          |           ^~~~

Prevent these warnings from being triggered by increasing the size of
the relevant arrays (task.c, rrl.c) and reordering conditions
(private_test.c).

(cherry picked from commit ce796ac1f4)
2019-06-11 10:19:26 +02:00
..
alpha Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 13:49:35 +02:00
ia64 Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 13:49:35 +02:00
include teach cppcheck that _assert_int_equal and _assert_int_not_equal don't return on failure 2019-06-04 15:24:18 +10:00
mips Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 13:49:35 +02:00
nls Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
noatomic Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 13:49:35 +02:00
nothreads Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 13:49:35 +02:00
powerpc Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 13:49:35 +02:00
pthreads Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 13:49:35 +02:00
sparc64 Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 13:49:35 +02:00
tests teach cppcheck that _assert_int_equal and _assert_int_not_equal don't return on failure 2019-06-04 15:24:18 +10:00
unix Fix race in unix socket code when closing a socket that has 2019-05-09 18:48:06 +02:00
win32 refactor tcpquota and pipeline refs; allow special-case overrun in isc_quota 2019-04-25 15:04:26 +02:00
x86_32 Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 13:49:35 +02:00
x86_64 Bail-out early in the for install loops instead of continuing because for masks the error in the middle 2018-09-03 13:49:35 +02:00
.gitignore [master] update gitignore files; use rev-parse to get srcid 2014-06-17 13:49:30 -07:00
aes.c Fix missing config.h in win32/socket.c and replace config.h with <config.h> 2018-08-11 11:00:50 +02:00
api prep 9.11.7 2019-05-10 05:03:46 +00:00
app_api.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
assertions.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
backtrace-emptytbl.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
backtrace.c Fix missing config.h in win32/socket.c and replace config.h with <config.h> 2018-08-11 11:00:50 +02:00
base32.c Ensure base64/base32/hex fields in DNS records that should be non-empty are. 2019-01-09 18:52:50 +11:00
base64.c Ensure base64/base32/hex fields in DNS records that should be non-empty are. 2019-01-09 18:52:50 +11:00
bind9.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
buffer.c Fix isc_buffer_copyregion() for auto-reallocated buffers 2018-10-30 13:34:49 +01:00
bufferlist.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
chacha_private.h silence compiler warnings 2014-06-10 12:38:32 +10:00
commandline.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
counter.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
crc64.c Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-10 15:20:57 +02:00
entropy.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
error.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
event.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
fsaccess.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
hash.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
heap.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
hex.c Ensure base64/base32/hex fields in DNS records that should be non-empty are. 2019-01-09 18:52:50 +11:00
hmacmd5.c add #include <isc/util.h> 2019-03-20 11:41:51 +11:00
hmacsha.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
ht.c add missing DBC checks for catz and add isc_magic checks; add DBC checks to ht.c 2018-11-29 15:05:17 +11:00
httpd.c Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 22:02:58 +07:00
inet_aton.c Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-10 15:20:57 +02:00
inet_ntop.c improve clang / cmocka integration 2019-03-05 11:04:46 -08:00
inet_pton.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
iterated_hash.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
Kyuafile regen v9_11 2017-12-29 02:23:11 +00:00
lex.c Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 22:02:58 +07:00
lfsr.c Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-10 15:20:57 +02:00
lib.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
log.c Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 22:02:58 +07:00
Makefile.in update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
md5.c add #include <isc/util.h> 2019-03-20 11:41:51 +11:00
mem.c Use isc__strerror instead of strerror_r in v9_11 branch 2018-12-21 09:26:50 +01:00
mutexblock.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
netaddr.c Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached 2018-11-08 22:42:52 +07:00
netscope.c Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-10 15:20:57 +02:00
ondestroy.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
parseint.c Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-10 15:20:57 +02:00
pk11.c Add small tweaks to the code to fix compilation when ISC assertions are disabled 2018-11-08 22:00:49 +07:00
pk11_result.c update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
pool.c expand the pool then copy over the old entries so we that failures do not break the old pool; also don't leak the new pool on error 2018-10-25 13:20:14 +11:00
portset.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
print.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
quota.c refactor tcpquota and pipeline refs; allow special-case overrun in isc_quota 2019-04-25 15:04:26 +02:00
radix.c Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 22:02:58 +07:00
random.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
ratelimiter.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
refcount.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
regex.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
region.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00
result.c Handle EDQUOT and ENOSPC errors 2019-03-07 21:29:59 -08:00
rwlock.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
safe.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
serial.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
sha1.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
sha2.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
sockaddr.c Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached 2018-11-08 22:42:52 +07:00
socket_api.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
stats.c Fix the stdatomic #ifdefs to work with older compilers 2018-12-21 09:29:47 +01:00
string.c Replace custom isc_u?intNN_t types with C99 u?intNN_t types 2018-08-10 15:20:57 +02:00
strtoul.c Remove duplicate config.h 2018-08-10 15:20:58 +02:00
symtab.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
task.c Address GCC 9.1 -O3 compilation warnings 2019-06-11 10:19:26 +02:00
task_p.h Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
taskpool.c Replace custom isc_boolean_t with C standard bool type 2018-08-10 15:20:57 +02:00
timer.c Fix crash caused by race condition in timer creation 2018-09-27 13:00:05 -07:00
timer_p.h update file headers to remove copyright years 2018-03-14 16:40:20 -07:00
tm.c Turn (int & flag) into (int & flag) != 0 when implicitly typed to bool 2018-11-08 22:02:58 +07:00
version.c Remove $Id markers, Principal Author and Reviewed tags from the full source tree 2018-05-11 14:25:15 +02:00