comparison runtime/doc/develop.txt @ 13726:d35b1702a1da v8.0.1735

patch 8.0.1735: flexible array member feature not supported by HP-UX commit https://github.com/vim/vim/commit/285e3358696b1bc6296e5d4c53425680ce8fbd54 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Apr 18 23:01:13 2018 +0200 patch 8.0.1735: flexible array member feature not supported by HP-UX Problem: Flexible array member feature not supported by HP-UX. (John Marriott) Solution: Do not use the flexible array member feature of C99.
author Christian Brabandt <cb@256bit.org>
date Wed, 18 Apr 2018 23:15:06 +0200
parents 30f9ebe3e602
children a62eeee5f116
comparison
equal deleted inserted replaced
13725:25ffa5f27874 13726:d35b1702a1da
207 Types ~ 207 Types ~
208 208
209 "long long" is allowed and can be expected to be 64 bits. Use %lld in printf 209 "long long" is allowed and can be expected to be 64 bits. Use %lld in printf
210 formats. Also "long long unsigned" with %llu. 210 formats. Also "long long unsigned" with %llu.
211 211
212 Flexible array members ~
213
214 This is an array without size, used as the last member of a struct. Vim used
215 to have an array of size one, which causes trouble with FORTIFY_SOURCE. Using
216 an "unsized array" is the intended use, we will change all of them.
217 struct some_stuff {
218 size_t length;
219 char payload[]; // will have size "length"
220 };
221
222 Not to be used ~ 212 Not to be used ~
223 213
224 These C99 features are not to be used, because not enough compilers support 214 These C99 features are not to be used, because not enough compilers support
225 them: 215 them:
226 - Declaration after Statements (MSVC 2012 does not support it). All 216 - Declaration after Statements (MSVC 2012 does not support it). All
227 declarations need to be at the start of the block. 217 declarations need to be at the start of the block.
228 - Variable length arrays (even in C11 this is an optional feature). 218 - Variable length arrays (even in C11 this is an optional feature).
229 - _Bool and _Complex types. 219 - _Bool and _Complex types.
230 - "inline" (it's hardly ever needed, let the optimizer do its work) 220 - "inline" (it's hardly ever needed, let the optimizer do its work)
221 - flexible array members: Not supported by HP-UX C compiler (John Marriott)
231 222
232 223
233 USE OF COMMON FUNCTIONS *style-functions* 224 USE OF COMMON FUNCTIONS *style-functions*
234 225
235 Some functions that are common to use, have a special Vim version. Always 226 Some functions that are common to use, have a special Vim version. Always