10019 libsldap: macro expands to multiple statements

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

tsoome
illumos-gate
10019
899802d...
general
../common/ns_reads.c: In function 'get_mapped_filter':
../common/ns_internal.h:217:2: error: macro expands to multiple statements [-Werror=multistatement-macros]
  if (((err) = calloc(1, sizeof (struct ns_ldap_error))) == NULL) \
  ^~
../common/ns_reads.c:1364:5: note: in expansion of macro 'MKERROR'
     MKERROR(LOG_WARNING, cookie->errorp,
     ^~~~~~~
../common/ns_reads.c:1363:4: note: some parts of macro expansion are not guarded by this 'if' clause
    if (err)
    ^~
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. same as 10017 and 10018 - the same issue does cause both warnings.

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

Status: Closed (submitted)

Loading...