23/04/12 16:36:09.61 bThMVtxz0.net
>>917
規格的には (関数定義の一部ではない) 宣言の段階なら不完全型であることを許しているように読める。
C99 だと 6.7.5.3 の第 12 段落に書かれている。
> If the function declarator is not part of a definition of that function,
> parameters may have incomplete type and may use the [*] notation in their sequences of
> declarator specifiers to specify variable length array types.
> 関数宣言子が関数定義の一部ではない場合,仮引数の型は不完全型でもよく,
> また宣言指定子列に [*] を使って可変長配列型を指定してもよい。
ちなみに GCC だと以下のようなものもエラーだが MSVC だと通る。
struct X;
typedef struct X Y[10];