9147 sun_sas: comparison between pointer and zero character constant

Review Request #880 — Created Feb. 20, 2018 and submitted

tsoome
illumos-gate
9147
acb1085...
general
../common/devtree_device_disco.c: In function 'get_attached_paths_info':
../common/devtree_device_disco.c:721:15: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
   if (charptr != '\0') {
               ^~
../common/devtree_device_disco.c:721:7: note: did you mean to dereference the pointer?
   if (charptr != '\0') {
       ^
cc1: all warnings being treated as errors


  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
seeemef@mac.com
  1. Ship It!
  2. 
      
citrus
  1. 
      
  2. From the loop above, this looks like it should be *charptr != '\0'

    1. yep, you are right. we wont be NULL and it has to check for terminating NUL byte.

  3. 
      
tsoome
citrus
  1. Ship It!
  2. 
      
seeemef@mac.com
  1. Ahh. LGTM.

  2. 
      
tsoome
Review request changed

Status: Closed (submitted)

Loading...