私はgccの前処理に関するドキュメントを読んでいる、私は次の文(here)読み:終了(GNUのドキュメント)
> echo -n "int main(void) {return 0;}" > test.c
> gcc -Wall -Wextra -Werror test.c
を:私は実行して警告を生成しようと
If the last line of any input file lacks an end-of-line marker, the end of the file is considered to implicitly supply one. The C standard says that this condition provokes undefined behavior, so GCC will emit a warning message.
を
しかしprobはない、それはコンパイルする。私は改行文字として改行マーカーを理解していますが、それは他のものと思われます。
警告はどのように生成できますか?
'gcc -W'。なぜあなたは警告なしでGCCを実行しますか? –
おそらく誰もこの状況を気にしません。 – bolov
@KerrekSBこれは本当ですが、彼の例で '-W'や' -Wall'を使っても、彼が記述している文書化された警告は得られません。最低でも 'gcc'バージョン4.7.2ではありません。 – lurker