9263 rdc: comparison between pointer and zero character constant

Review Request #939 — Created March 11, 2018 and submitted

tsoome
illumos-gate
9263
f68bc72...
general
../../common/avs/ns/rdc/rdc_diskq.c:195:27: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
  if (&urdc->disk_queue[0] == '\0') {
                           ^~
../../common/avs/ns/rdc/rdc_diskq.c:195:6: note: did you mean to dereference the pointer?
  if (&urdc->disk_queue[0] == '\0') {
      ^
../../common/avs/ns/rdc/rdc_diskq.c: In function 'rdc_read_diskq_header':
../../common/avs/ns/rdc/rdc_diskq.c:609:28: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
       &urdc->group_name[0] == '\0' ? buf:
                            ^~
../../common/avs/ns/rdc/rdc_diskq.c:609:7: note: did you mean to dereference the pointer?
       &urdc->group_name[0] == '\0' ? buf:
       ^
../../common/avs/ns/rdc/rdc_diskq.c:629:32: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
       rc, &urdc->group_name[0] == '\0' ? buf :
                                ^~
../../common/avs/ns/rdc/rdc_diskq.c:629:11: note: did you mean to dereference the pointer?
       rc, &urdc->group_name[0] == '\0' ? buf :
           ^
cc1: all warnings being treated as errors


jbk
  1. Ship It!
  2. 
      
domag02
  1. Isn't it necessary to check for NULL pointer before checking for empty string?
    1. No because the struct members are char arrays - see http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/avs/ns/rdc/rdc_ioctl.h#187

  2. 
      
citrus
  1. Ship It!
  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...