From 315076a26d225a3bdc34a2cbba1f124adf4e1087 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 16 Jun 2019 18:58:07 -0400 Subject: vim-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. https://github.com/vim/vim/commit/f3a411783c9736645d6ba480c5ff9d861164c040 The following patch is N/A because Neovim requires C99. vim-patch:8.0.1735: flexible array member feature not supported by HP-UX --- src/nvim/buffer_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 69cefe2247..4b0e680c25 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -133,14 +133,14 @@ 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) }; /* * header used for the stuff buffer and the redo buffer */ 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 size_t bh_index; // index for reading size_t bh_space; // space in bh_curr for appending -- cgit