rsyslog / librelp

OFFICIAL librelp repository on github
https://www.rsyslog.com/librelp/
GNU General Public License v3.0
30 stars 35 forks source link

tcp: fix some compiler warnings with enable-tls-openssl #255

Closed williamspatrick closed 1 year ago

williamspatrick commented 1 year ago

When --enable-tls=no and --enable-tls-openssl=yes, the following compiler errors are reported:

| ../../git/src/tcp.c:3765:1: error: no previous declaration for 'relpTcpGetRtryDirection_gtls' [-Werror=missing-declarations]
|  3765 | relpTcpGetRtryDirection_gtls(LIBRELP_ATTR_UNUSED relpTcp_t *const pThis)
|       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| ../../git/src/tcp.c:3583:1: error: 'relpTcpChkPeerName' defined but not used [-Werror=unused-function]
|  3583 | relpTcpChkPeerName(NOTLS_UNUSED relpTcp_t *const pThis, NOTLS_UNUSED void* cert)
|       | ^~~~~~~~~~~~~~~~~~

Fix these by:

  1. Add static on the openssl path for relpTcpGetRtryDirection_gtls.
  2. Move the relpTcpChkPeerName forward declaration to another ifdef leg.
  3. Wrap relpTcpChkPeerName in gnutls-based ifdef.
  4. Remove relpTcpChkPeerName_gtls from openssl path.

Signed-off-by: Patrick Williams patrick@stwcx.xyz