[PATCH v5 1/6] cmdline: include stddef.h for offsetof

Lukas Sismis
2026-01-27T18:47:50Z

Include <stddef.h> at the top of cmdline_parse.h before the
fallback offsetof macro definition. This prevents macro
redefinition warnings when building with MSVC which uses /WX
(warnings as errors).

The standard header provides offsetof on all platforms, and
including it first ensures the fallback is only used when truly
needed.

Signed-off-by: Lukas Sismis <sismis@dyna-nic.com>
---
lib/cmdline/cmdline_parse.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/lib/cmdline/cmdline_parse.h b/lib/cmdline/cmdline_parse.h
index d9a7d86256..c4131e4af5 100644
--- a/lib/cmdline/cmdline_parse.h
+++ b/lib/cmdline/cmdline_parse.h
@@ -7,6 +7,8 @@
#ifndef _CMDLINE_PARSE_H_
#define _CMDLINE_PARSE_H_

+#include <stddef.h>
+
#ifdef __cplusplus
extern "C" {
#endif
--
2.43.7