10018 libkmf: macro expands to multiple statements

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

tsoome
illumos-gate
10018
dbd0f3a...
general
../common/openssl_spi.c:1037:13: error: macro expands to multiple statements [-Werror=multistatement-macros]
   SET_ERROR(kmfh, ERR_get_error());
             ^~~~
../common/openssl_spi.c:134:25: note: in definition of macro 'SET_ERROR'
 #define SET_ERROR(h, c) h->lasterr.kstype = KMF_KEYSTORE_OPENSSL; \
                         ^
../common/openssl_spi.c:1036:2: note: some parts of macro expansion are not guarded by this 'if' clause
  if (pkey == NULL)
  ^~

../common/pkcs11_spi.c: In function 'store_raw_key':
../common/pkcs11_spi.c:3249:11: error: macro expands to multiple statements [-Werror=multistatement-macros]
   SETATTR(templ, i, CKA_DECRYPT, &cktrue, sizeof (cktrue)); i++;
           ^~~~~
../common/pkcs11_spi.c:43:2: note: in definition of macro 'SETATTR'
  t[n].type = atype; \
  ^
../common/pkcs11_spi.c:3248:2: note: some parts of macro expansion are not guarded by this 'if' clause
  if (keytype != CKK_EC)
  ^~

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 with 10017 - both warnings have the same cause.

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

Status: Closed (submitted)

Loading...