0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

patch 8.0.1723: using one item array size declaration is misleading

Problem:    Using one item array size declaration is misleading.
Solution:   Instead of using "[1]" and actually using a larger array, use
            "[]".  This is to verify that this C99 feature works for all
            compilers.
This commit is contained in:
Bram Moolenaar
2018-04-16 14:45:45 +02:00
parent 498c2562e1
commit f3a411783c
3 changed files with 53 additions and 41 deletions

View File

@@ -511,7 +511,7 @@ typedef struct buffheader buffheader_T;
struct buffblock
{
buffblock_T *b_next; /* pointer to next buffblock */
char_u b_str[1]; /* contents (actually longer) */
char_u b_str[]; /* contents (flexible array) */
};
/*
@@ -519,7 +519,7 @@ struct buffblock
*/
struct buffheader
{
buffblock_T bh_first; /* first (dummy) block of list */
buffblock_T *bh_first; /* first block of the list */
buffblock_T *bh_curr; /* buffblock for appending */
int bh_index; /* index for reading */
int bh_space; /* space in bh_curr for appending */