In some places of the ChibiOS code there are definition of the structures with flexible array members.
For example file ..\os\oslib\include\chfactory.h:
Code: Select all
213 typedef struct ch_dyn_object {
214 /**
215 * @brief List element of the dynamic buffer object.
216 */
217 dyn_element_t element;
218 /*lint -save -e9038 [18.7] Required by design.*/
219 /**
220 * @brief The buffer.
221 * @note This requires C99.
222 */
223 uint8_t buffer[];
224 /*lint restore*/
225 } dyn_buffer_t;
But KEIL compiller does not support it even with C99 turned ON:
Code: Select all
..\lib\ChibiOS\os\oslib\include\chfactory.h(223): error: #70: incomplete type is not allowed
uint8_t buffer[];
I do not use factory before but turned this option ON and have this errors.
I think it is possible do this work without "flexible" exentsions for compability with different compillers. Is'nt it?