Annotate potential -Wunused-function violations in err.h
authorjwalch <jeremy.walch@gmail.com>
Thu, 10 Sep 2020 16:14:40 +0000 (12:14 -0400)
committerPauli <paul.dale@oracle.com>
Thu, 17 Sep 2020 08:05:41 +0000 (18:05 +1000)
Fixes #12792

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12851)

include/openssl/err.h

index 3e3b64b15870bbae9671eec9c7c80a70ceb01f52..8e76b812df45d5fc3f13a53fe90a597711066ab7 100644 (file)
@@ -214,33 +214,33 @@ struct err_state_st {
 
 # define ERR_SYSTEM_ERROR(errcode)      (((errcode) & ERR_SYSTEM_FLAG) != 0)
 
-static ossl_inline int ERR_GET_LIB(unsigned long errcode)
+static ossl_unused ossl_inline int ERR_GET_LIB(unsigned long errcode)
 {
     if (ERR_SYSTEM_ERROR(errcode))
         return ERR_LIB_SYS;
     return (errcode >> ERR_LIB_OFFSET) & ERR_LIB_MASK;
 }
 
-static ossl_inline int ERR_GET_FUNC(unsigned long errcode ossl_unused)
+static ossl_unused ossl_inline int ERR_GET_FUNC(unsigned long errcode ossl_unused)
 {
     return 0;
 }
 
-static ossl_inline int ERR_GET_RFLAGS(unsigned long errcode)
+static ossl_unused ossl_inline int ERR_GET_RFLAGS(unsigned long errcode)
 {
     if (ERR_SYSTEM_ERROR(errcode))
         return 0;
     return errcode & (ERR_RFLAGS_MASK << ERR_RFLAGS_OFFSET);
 }
 
-static ossl_inline int ERR_GET_REASON(unsigned long errcode)
+static ossl_unused ossl_inline int ERR_GET_REASON(unsigned long errcode)
 {
     if (ERR_SYSTEM_ERROR(errcode))
         return errcode & ERR_SYSTEM_MASK;
     return errcode & ERR_REASON_MASK;
 }
 
-static ossl_inline int ERR_FATAL_ERROR(unsigned long errcode)
+static ossl_unused ossl_inline int ERR_FATAL_ERROR(unsigned long errcode)
 {
     return (ERR_GET_RFLAGS(errcode) & ERR_RFLAG_FATAL) != 0;
 }