diff --git a/include/zephyr/drivers/i3c.h b/include/zephyr/drivers/i3c.h index 4e94c890b3b..5d48a360999 100644 --- a/include/zephyr/drivers/i3c.h +++ b/include/zephyr/drivers/i3c.h @@ -1189,9 +1189,16 @@ struct i3c_driver_config { /** I3C Primary Controller Dynamic Address */ uint8_t primary_controller_da; +#elif defined(CONFIG_CPP) + /* Empty struct has size 0 in C, size 1 in C++. Force them to be the same. */ + uint8_t unused_cpp_size_compatibility; #endif }; +#if defined(CONFIG_CPP) +BUILD_ASSERT(sizeof(struct i3c_driver_config) >= 1); +#endif + /** * This structure is common to all I3C drivers and is expected to be the first * element in the driver's struct driver_data declaration.