From 9d2f7ead0630cad3385b2fe179f338308bbd695d Mon Sep 17 00:00:00 2001 From: kartikey1306 Date: Tue, 1 Sep 2026 17:04:33 +0530 Subject: [PATCH 1/2] fix(tests): include assert.h in test_net.c, which master no longer builds master does not compile: tests/test_net.c:212:5: error: call to undeclared function 'assert'; ISO C99 and later do not support implicit function declarations test_net.c makes ten assert() calls and includes stdio, stdlib and string but never assert.h. It built while every test target was compiled with NDEBUG, and #104 removed that from test targets so the assertions in these suites are real again -- which is what turned the missing include into an error. The include is what the file always needed; nothing else changes. Swept the rest of tests/*.c and this is the only file that calls assert() without including the header. Restores the build: 34/34, and the assertions are live in the binary rather than compiled away. Co-Authored-By: Claude Opus 5 (1M context) --- tests/test_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_net.c b/tests/test_net.c index d3c0f61c..02a8aee1 100644 --- a/tests/test_net.c +++ b/tests/test_net.c @@ -1,4 +1,5 @@ // SPDX-License-Identifier: MIT +#include #include #include #include From 2401fba99886acff2a37f726bd1e5dc48feb1cbb Mon Sep 17 00:00:00 2001 From: kartikey1306 Date: Tue, 1 Sep 2026 17:18:43 +0530 Subject: [PATCH 2/2] fix(net): guard net_posix.c, which broke every non-test build A plain `cmake -S . -B build` -- the default configuration, and what the library job in CI runs -- does not compile: net/src/net_posix.c:43:30: error: unknown type name 'eos_net_addr_t' net/src/net_posix.c:73:1: error: unknown type name 'eos_socket_t' ... 30 more eos/net.h puts every eNet declaration behind EOS_ENABLE_NET. CMakeLists.txt defines that only for `EOS_BUILD_TESTS AND NOT EOS_PRODUCT`, but net/src/net_posix.c is in eos_net's source list unconditionally. Built without the feature the header contributes no types, and every definition in the file fails. That is why the break is invisible locally: -DEOS_BUILD_TESTS=ON is what anyone running the suite passes, and it is the one configuration that defines the flag. Guard the body the way the header is guarded, so the translation unit compiles away when the feature is off -- which is what a disabled feature should do -- instead of failing to compile. Both configurations now build: the default one, and -DEOS_BUILD_TESTS=ON at 34/34 with eos_net_socket still linked into libeos_net.a. Co-Authored-By: Claude Opus 5 (1M context) --- net/src/net_posix.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/src/net_posix.c b/net/src/net_posix.c index b1127ea2..c938dbf6 100644 --- a/net/src/net_posix.c +++ b/net/src/net_posix.c @@ -25,6 +25,15 @@ #include "eos/net.h" +/* eos/net.h puts every eNet declaration behind EOS_ENABLE_NET, but this + * file is in eos_net's source list unconditionally. Built without the + * feature -- which is the default configuration, since CMakeLists.txt only + * defines EOS_ENABLE_NET for the test build -- the header contributed no + * types and every definition below failed with "unknown type name + * eos_socket_t". Guarding the body compiles it away instead, which is what + * a disabled feature is supposed to do. */ +#if EOS_ENABLE_NET + #include #include #include @@ -203,3 +212,5 @@ int eos_net_resolve(const char *hostname, uint32_t *ip) freeaddrinfo(res); return 0; } + +#endif /* EOS_ENABLE_NET */