Skip to content

Commit acebd85

Browse files
authored
Merge pull request #274 from mnishz/develop_for_Vim_8.1
Update develop from Vim 8.0 to 8.1
2 parents 94b0438 + dc12c38 commit acebd85

File tree

2 files changed

+75
-12
lines changed

2 files changed

+75
-12
lines changed

doc/develop.jax

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*develop.txt* For Vim バージョン 8.0. Last change: 2017 Jul 31
1+
*develop.txt* For Vim バージョン 8.1. Last change: 2018 May 02
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -16,7 +16,8 @@ Vimの開発 *development*
1616
ソースコードの概要については "src" ディレクトリのREADME.txtを見てください。
1717

1818
Vimはオープンソースソフトウェアです。誰でもVimの開発に協力できます。パッチを送
19-
る時はなるべく "context diff" 形式 ("diff -c" で作る) でお願いします。
19+
る時はなるべく "unified diff" 形式 ("diff -u" で作る) でお願いします。
20+
GitHub上でプルリクエストを作ることも可能ですが、必須ではありません。
2021
http://vim.wikia.com/wiki/How_to_make_and_submit_a_patch も見てください。
2122

2223
==============================================================================
@@ -185,14 +186,44 @@ MAKING CHANGES *style-changes*
185186
るか GitHub でプルリクエストを作成する。
186187

187188

188-
C COMPILER *style-compiler*
189+
C COMPILER *style-compiler* *ANSI-C* *C89* *C99*
189190

190191
サポートされている最小の C コンパイラのバージョンは C89 (ANSI C とも呼ばれてい
191-
る) である。C89 以降の標準規格にはあまり多くの機能追加が無く C89 はもっとも普及
192-
している。
192+
る) である。C99 のような後継の標準規格はあまり普及していない、もしくは少なくと
193+
も 100% サポートされているわけではない。したがって C99 のいくつかの機能だけを
194+
使用し、その他の使用は (少なくとも現時点では) 禁止する。
193195

194-
この項目が暗に示している制限の1つとして、 // コメントではなく /* コメント */ を
195-
使わなければならない。
196+
現存するパッチに対してマージの問題を引き起こすため、C99の機能を使う変更を至る
197+
所に入れてはいけない。新しくコードを書く場合、もしくは既存のコードを書き直す場
198+
合に限り使用してもよい。
199+
200+
コメント ~
201+
202+
慣習的に Vim では /* コメント */ を使用する。特にファイルと関数のヘッダに関し
203+
てはこれを維持するつもりである。新しいコードもしくは変更される行については、
204+
// コメント を使用してもよい。特にコードの後ろに続くコメントなど:
205+
int some_var; // single line comment useful here
206+
207+
列挙型 (Enums) ~
208+
209+
列挙型の末尾の要素にコンマ (trailing comma) が付いていてもよい。C89 では認めら
210+
れていなかった。
211+
212+
型 (Types) ~
213+
214+
"long long" は使用してもよく、64 bit を想定している。printf では %lld を使用す
215+
ること。同じように "long long unsigned" では %llu を使用する。
216+
217+
使用してはいけないもの ~
218+
219+
これらの C99 の機能は、コンパイラのサポートが不十分なため使用してはいけない。
220+
- ステートメントの後の宣言 (MSVC 2012 はこれをサポートしていない)。すべての宣
221+
言はブロックの先頭になければならない。
222+
- 可変長配列 (C11 でもこれはオプショナルな機能である)。
223+
- _Bool 型と _Complex 型。
224+
- "inline" (ほとんど必要ない、コンパイラに最適化させよう。)
225+
- フレキシブル配列メンバ: HP-UX C コンパイラはサポートしていない。(John
226+
Marriott)
196227

197228

198229
USE OF COMMON FUNCTIONS *style-functions*

en/develop.txt

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
22

33

44
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
1818
code.
1919

2020
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.
2223
Also see http://vim.wikia.com/wiki/How_to_make_and_submit_a_patch.
2324

2425
==============================================================================
@@ -182,12 +183,43 @@ The basic steps to make changes to the code:
182183
include the diff. Or create a pull request on github.
183184

184185

185-
C COMPILER *style-compiler*
186+
C COMPILER *style-compiler* *ANSI-C* *C89* *C99*
186187

187188
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).
189192

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)
191223

192224

193225
USE OF COMMON FUNCTIONS *style-functions*

0 commit comments

Comments
 (0)