Mark the forwarding packet builders maybe-unused

BuildDirectTcpipExtra() and BuildGlobalRequestFwdPacket() have callers in
several conditional blocks, and a build with none of them left the two
functions unused, which -Werror turns into a build failure.
ReadUint32() next to them already carries the attribute for the same
reason.

- --disable-server builds regress.c again.
pull/1214/head
John Safranek 2026-08-14 15:11:47 -07:00 committed by philljj
parent 7325678553
commit 6c83a2bfc9
1 changed files with 6 additions and 4 deletions

View File

@ -291,8 +291,10 @@ static word32 BuildChannelDataPacket(word32 peerChannelId, const char* data,
#ifdef WOLFSSH_FWD
static word32 BuildDirectTcpipExtra(const char* host, word32 hostPort,
const char* origin, word32 originPort, byte* out, word32 outSz)
/* Callers sit in separate conditional blocks; some builds have none. */
static WS_MAYBE_UNUSED word32 BuildDirectTcpipExtra(const char* host,
word32 hostPort, const char* origin, word32 originPort, byte* out,
word32 outSz)
{
word32 idx = 0;
@ -304,8 +306,8 @@ static word32 BuildDirectTcpipExtra(const char* host, word32 hostPort,
return idx;
}
static word32 BuildGlobalRequestFwdPacket(const char* bindAddr, word32 bindPort,
int isCancel, byte wantReply, byte* out, word32 outSz)
static WS_MAYBE_UNUSED word32 BuildGlobalRequestFwdPacket(const char* bindAddr,
word32 bindPort, int isCancel, byte wantReply, byte* out, word32 outSz)
{
byte payload[256];
word32 idx = 0;