On Thu, Jan 29, 2026 at 12:41:57PM +0100, Lukas Sismis wrote:
> Include <stddef.h> at the top of cmdline_parse.h before the
> fallback offsetof macro definition. This improves MSVC build
> compatibility by ensuring the standard offsetof is available
> before the fallback definition, avoiding macro redefinition
> warnings when building with /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 <[email protected]>
> ---
> 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
> --
Acked-by: Bruce Richardson <[email protected]>