From aa1724fa0ccdc30096df7e51d9d6735407ecf2e5 Mon Sep 17 00:00:00 2001 From: Afonso Oliveira Date: Mon, 12 Oct 2026 13:44:23 +0100 Subject: [PATCH] fix(px4_mtd): forward-declare the NuttX structs used in prototypes px4_at24c_initialize() takes a struct i2c_master_s pointer. Without a declaration in scope the struct is local to the prototype, which is an error with -Werror on a target that does not include the NuttX I2C headers before px4_mtd.h. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Afonso Oliveira --- platforms/common/include/px4_platform_common/px4_mtd.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platforms/common/include/px4_platform_common/px4_mtd.h b/platforms/common/include/px4_platform_common/px4_mtd.h index 36daee0cd23..eb70bb7cc8a 100644 --- a/platforms/common/include/px4_platform_common/px4_mtd.h +++ b/platforms/common/include/px4_platform_common/px4_mtd.h @@ -34,6 +34,9 @@ #include #include +struct i2c_master_s; +struct mtd_dev_s; + __BEGIN_DECLS #define MAX_MTD_INSTANCES 5u