10017 libilb: macro expands to multiple statements

Review Request #1303 — Created Nov. 30, 2018 and submitted

tsoome
illumos-gate
10017
01db00b...
general
../common/ilb_sg.c: In function 'i_ilb_fillin_srvdata':
../common/libilb_impl.h:79:2: error: macro expands to multiple statements [-Werror=multistatement-macros]
  bzero(_i, sizeof (*(_i)));    \
  ^~~~~
../common/ilb_sg.c:430:3: note: in expansion of macro 'IP_COPY_CLI_2_IMPL'
   IP_COPY_CLI_2_IMPL(&srv->sd_addr, &sgs->sgs_addr);
   ^~~~~~~~~~~~~~~~~~
../common/ilb_sg.c:429:2: note: some parts of macro expansion are not guarded by this 'else' clause
  else
  ^~~~
cc1: all warnings being treated as errors


rm
  1. It looks like this fixes the case where the statement is expanded to multiple statements in an if that isn't properly guarded. Does it actually fix the multiple statement warning? Regardless since it does fix one of the cases, seems fine.
    1. it does fix both, because the root cause is the same for those 2 warnings.

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

Status: Closed (submitted)

Loading...