1
- *develop.txt* For Vim version 8.0 . Last change: 2017 Jul 31
1
+ *develop.txt* For Vim version 8.1 . Last change: 2018 May 02
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -18,7 +18,8 @@ See the file README.txt in the "src" directory for an overview of the source
18
18
code.
19
19
20
20
Vim is open source software. Everybody is encouraged to contribute to help
21
- improving Vim. For sending patches a context diff "diff -c" is preferred.
21
+ improving Vim. For sending patches a unified diff "diff -u" is preferred.
22
+ You can create a pull request on github, but it's not required.
22
23
Also see http://vim.wikia.com/wiki/How_to_make_and_submit_a_patch .
23
24
24
25
==============================================================================
@@ -182,12 +183,43 @@ The basic steps to make changes to the code:
182
183
include the diff. Or create a pull request on github.
183
184
184
185
185
- C COMPILER *style-compiler*
186
+ C COMPILER *style-compiler* *ANSI-C* *C89* *C99 *
186
187
187
188
The minimal C compiler version supported is C89, also known as ANSI C.
188
- Later standards don't add much and C89 is the widest supported.
189
+ Later standards, such as C99, are not widely supported, or at least not 100%
190
+ supported. Therefore we use only some of the C99 features and disallow some
191
+ (at least for now).
189
192
190
- One restriction that this implies: no // comments, only /* comments */.
193
+ Please don't make changes everywhere to use the C99 features, it causes merge
194
+ problems for existing patches. Only use them for new and changed code.
195
+
196
+ Comments ~
197
+
198
+ Traditionally Vim uses /* comments */. We intend to keep it that way,
199
+ especially for file and function headers. For new code or lines of code that
200
+ change, it is allowed to use // comments. Especially when it comes after
201
+ code:
202
+ int some_var; // single line comment useful here
203
+
204
+ Enums ~
205
+
206
+ The last item in an enum may have a trailing comma. C89 didn't allow this.
207
+
208
+ Types ~
209
+
210
+ "long long" is allowed and can be expected to be 64 bits. Use %lld in printf
211
+ formats. Also "long long unsigned" with %llu.
212
+
213
+ Not to be used ~
214
+
215
+ These C99 features are not to be used, because not enough compilers support
216
+ them:
217
+ - Declaration after Statements (MSVC 2012 does not support it). All
218
+ declarations need to be at the start of the block.
219
+ - Variable length arrays (even in C11 this is an optional feature).
220
+ - _Bool and _Complex types.
221
+ - "inline" (it's hardly ever needed, let the optimizer do its work)
222
+ - flexible array members: Not supported by HP-UX C compiler (John Marriott)
191
223
192
224
193
225
USE OF COMMON FUNCTIONS *style-functions*
0 commit comments