From 42bbed9661251840eca7a4c5385fb7bdd9f3892a Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Fri, 18 Sep 2026 16:09:56 +0200 Subject: [PATCH] httpd: brace the empty else body so the host tests build clean gcc flags the else whose only statement is dbg_string(), because that macro expands to nothing unless DEBUG is on, leaving the branch with an empty body. The line is older than this branch; the bench is simply the first thing that compiles httpd.c with a host compiler and -Wall -Wextra. Turn warnings into errors in the test Makefile too, so the next one is caught where it appears instead of scrolling past. It is the only warning the four test binaries produce, so nothing else has to change. --- httpd/httpd.c | 3 ++- test/Makefile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/httpd/httpd.c b/httpd/httpd.c index 1d5fadf8..2c67e4c2 100644 --- a/httpd/httpd.c +++ b/httpd/httpd.c @@ -348,8 +348,9 @@ __xdata uint8_t *scan_header(__xdata uint8_t * __xdata p) if (is_word_x(session, session_id)) { authenticated = 1; last_session_use = now; - } else + } else { dbg_string("Invalid session cookie!\n"); + } } } return p; diff --git a/test/Makefile b/test/Makefile index 1f7a63ef..e394aec4 100644 --- a/test/Makefile +++ b/test/Makefile @@ -11,7 +11,7 @@ CC = gcc SRCROOT = .. # -include shim first so __xdata/__code/__banked vanish before any firmware header. -CFLAGS = -std=gnu11 -g -O1 -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas \ +CFLAGS = -std=gnu11 -g -O1 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-unknown-pragmas \ -Wno-pointer-sign \ -DRTLP_HOST_TEST \ -fsanitize=address,undefined -fno-omit-frame-pointer \