[PATCH v2 7/7] cmdline: include stddef.h before defining offsetof
Lukas Sismis
sismis at dyna-nic.com
Tue Jan 6 16:38:37 CET 2026
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 at 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
More information about the dev
mailing list