Fix gcc -Warray-bounds check for dump_object() in zdb
commitffddb4dfaba420f2f07e82c1dc083c1d11af9bee
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 1 Aug 2016 17:42:04 +0000 (1 17:42 +0000)
committerNed Bass <bass6@llnl.gov>
Fri, 9 Sep 2016 20:21:10 +0000 (9 13:21 -0700)
tree2434e2e8ae16061747b1fc7f4a884d1175d7c8ba
parent8fe1fb14cb242033a1dc34aedbe35267c8d2f224
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