]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix gcc -Warray-bounds check for dump_object() in zdb
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 1 Aug 2016 17:42:04 +0000 (17:42 +0000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 2 Aug 2016 20:14:47 +0000 (13:14 -0700)
commitf3c9cac14355ba45b4ceced4df32c18bfc2518ed
treea171313cb9124c2ff06e6738615479b6239270af
parentefe7978d89f84f08afd9a3bf84a293773b66632d
Fix gcc -Warray-bounds check for dump_object() in zdb

As of gcc 6.1.1 20160621 (Red Hat 6.1.1-3) an array bounds warnings
is detected in the zdb the dump_object() function.  The analysis is
correct but difficult to interpret because this is implemented as a
macro.  Rework the ZDB_OT_NAME in to a function and remove the case
detected by gcc which is a side effect of the DMU_OT_IS_VALID() macro.

  zdb.c: In function â€˜dump_object’:
  zdb.c:1931:288: error: array subscript is outside array bounds
      [-Werror=array-bounds]

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Gvozden Neskovic <neskovic@gmail.com>
Closes #4907
cmd/zdb/zdb.c