From: KOSAKI Motohiro Date: 2010-12-06T21:09:36+09:00 Subject: [ruby-dev:42694] Re: [Ruby 1.9-Bug#4120][Assigned] 2 failures on test/mkmf/test_convertible.rb 2010年12月6日15:53 U.Nakamura : > こんにちは、なかむら(う)です。 > > In message "[ruby-dev:42688] Re: [Ruby 1.9-Bug#4120][Assigned] 2 failures on test/mkmf/test_convertible.rb" >    on Dec.06,2010 15:34:02, wrote: >> VCでは以下のコードがエラーにならずに警告しか出ないからなのですが、何を >> 考えているんでしょうね。 > > 規格上これをエラーにしないといけないというルールはないような > 気がするので[要確認]、普通に同じ幅なので警告で許してやろうと > いうことでしょうかねえ。 最近はC言語の規格もインターネットで閲覧できるんですね。インターネット万歳 http://www.open-std.org/JTC1/SC22/WG14/www/docs/n1256.pdf 3.5 DECLARATIONS (snip) All declarations in the same scope that refer to the same object or function shall specify compatible types. compatible typesの定義をみると 6.2.7 Compatible type and composite type Two types have compatible type if their types are the same. Additional rules for determining whether two types are compatible are described in 6.7.2 for type specifiers, in 6.7.3 for type qualifiers, and in 6.7.5 for declarators. なんか、基本厳密一致だけど詳細は type specifiersの章を見ろというのでみる 6.7.2 Type specifiers Syntax type-specifier: void char short int long float double signed unsigned _Bool _Complex struct-or-union-specifier ∗ enum-specifier typedef-name Constraints (snip) the type specifiers may occur in any order, possibly intermixed with the other declaration specifiers. 順序とか気にしなくていいよ。だそうな 適当に斜め読みしただけなので見落としてるかも知れませんがgccが正しそうな雰囲気。 JIS X3010 (ようするにC89)も見ましたが、同じように見えます。 > > なので、だとしたら、これがエラーになることを利用する奴が悪い > ということになるんじゃないでしょうか。 とはいえ、VCを無視するのは現実的ではないのでテストケース側を直すことに賛成します。