8717 autofs: parameter/variable set but not used

Review Request #674 — Created Oct. 13, 2017 and submitted

tsoome
illumos-gate
8717
be47c12...
general
ns_files.c: In function 'call_read_execout':
ns_files.c:684:37: error: parameter 'lp' set but not used [-Werror=unused-but-set-parameter]
 call_read_execout(char *key, char **lp, char *fname, char *line,
                                     ^~

autod_nfs.c: In function 'read_default_nfs':
autod_nfs.c:3985:16: error: variable 'lastread' set but not used [-Werror=unused-but-set-variable]
  static time_t lastread = 0;
                ^~~~~~~~

cc1: all warnings being treated as errors

did add entry into auto_master:
/test auto_exec

and the script has:
root@beastie:/test# more /etc/auto_exec

!/bin/sh

echo "localhost:/export/&"
exit 0

and verified the mounts are done - so the exec maps are still working as expected.

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
seeemef@mac.com
  1. LGTM

  2. 
      
igork
  1. Ship It!
  2. 
      
rm
  1. 
      
  2. usr/src/cmd/fs.d/autofs/ns_files.c (Diff revision 1)
     
     
    So why does the compiler complain about this? This feels really weird to me. For parameters, isn't it a common pattern to have output data which will be set and not read?
    1. Indeed, we can clear it more than just simple silencing. If anything, the assignment should use *lp, but in fact, that argument is not needed at all, since the caller does not need that pointer to be returned.

  3. 
      
tsoome
tsoome
rm
  1. Ship It!
  2. 
      
seeemef@mac.com
  1. still LGTM

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

Status: Closed (submitted)

Loading...