Skip to content

Commit

Permalink
shell: Use proper flexible array
Browse files Browse the repository at this point in the history
0 length array is a GNU extension. Use proper C99 flexible
array.

Signed-off-by: Flavio Ceolin <[email protected]>
  • Loading branch information
ceolin committed Nov 25, 2024
1 parent 9a34c1d commit de28c78
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion subsys/shell/shell_history.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zephyr/shell/shell_history.h>
#include <zephyr/sys/util.h>
#include <string.h>

/*
Expand Down Expand Up @@ -42,7 +43,7 @@ struct shell_history_item {
sys_dnode_t dnode;
uint16_t len;
uint16_t padding;
char data[0];
FLEXIBLE_ARRAY_DECLARE(char, data);
};

void z_shell_history_mode_exit(struct shell_history *history)
Expand Down

0 comments on commit de28c78

Please sign in to comment.