Confusing #if nesting in hmac_openssl.c
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2024-04-02T00:01:41Z
Lists: pgsql-hackers
Attachments
- refactor-hmac-resowner-coding.patch (text/x-diff) patch
I noticed that buildfarm member batfish has been complaining like this for awhile: hmac_openssl.c:90:1: warning: unused function 'ResourceOwnerRememberHMAC' [-Wunused-function] hmac_openssl.c:95:1: warning: unused function 'ResourceOwnerForgetHMAC' [-Wunused-function] Looking at the code, this is all from commit e6bdfd970, and apparently batfish is our only animal that doesn't HAVE_HMAC_CTX_NEW. I tried to understand the #if nesting and soon got very confused. I don't think it is helpful to put the resource owner manipulations inside #ifdef HAVE_HMAC_CTX_NEW and HAVE_HMAC_CTX_FREE --- probably, it would never be the case that only one of those is defined, but it just seems messy. What do you think of rearranging it as attached? regards, tom lane
Commits
-
Unwind #if spaghetti in hmac_openssl.c a bit.
- 38698dd38e56 17.0 landed
-
Refactor HMAC implementations
- e6bdfd9700eb 14.0 cited