其中一个原因可能是 gcc 的创建者和原始首席开发者 Richard Stallman 的个人品味。这是我上面提到的他的信息:
Date: Thu, 2 Sep 1999 23:19:27 -0400
Message-Id: <gnusenet199909030319.XAA08701@psilocin.gnu.org>
From: Richard Stallman <rms@gnu.org>
To: gnu-prog@gnu.org
Subject: On using -Wall in GCC
Reply-to: rms@gnu.org
Resent-From: info-gnu-prog-request@gnu.org
Status: RO
Content-Length: 841
Lines: 17
I'd like to remind all GNU developers that the GNU Project
does not urge or recommend using the GCC -Wall option.
When I implemented the -Wall option, I implemented every warning that
anyone asked for (if it was possible). I implemented warnings that
seemed useful, and warnings that seemed silly, deliberately without
judging them, to produce a feature which is at the upper limit of
strictness.
If you want such strict criteria for your programs, then -Wall is for
you. But changing code to avoid them is a lot of work. If you don't
feel inclined to do that work, please don't let anyone else pressure
you into using -Wall. If people say they would like to use it, you
don't have to listen. They're asking you to do a lot of work.
If you don't feel it is useful, you don't have to do it.
I never use -Wall myself.
在gcc-2.7.2.3 的ChangeLog.4 文件中,-Wstrict-prototypes 选项(尽管在 1992 年 1 月出现在 gcc 1.42 中)被首次提到与 -Wall 不同:
Thu Nov 21 15:34:27 1991 Michael Meissner (meissner at osf.org)
* gcc.texinfo (warning options): Make the documentation agree with
the code, -Wstrict-prototypes and -Wmissing-prototypes are not
turned on via -Wall; -Wnoparenthesis is now spelled
-Wno-parenthesis.
(option header): Mention that -W options take the no- prefix as well
as -f options.
此外,在文档 (gcc.info-3) 中,它出现在本段开头的部分:
The remaining `-W...' options are not implied by `-Wall' because
they warn about constructions that we consider reasonable to use, on
occasion, in clean programs.
选项本身是这样记录的:
`-Wstrict-prototypes'
Warn if a function is declared or defined without specifying the
argument types. (An old-style function definition is permitted
without a warning if preceded by a declaration which specifies the
argument types.)
考虑到上下文,将选项分开的原因很容易理解:这仅在 C 标准化几年后,很少有程序转换为 ANSI C。gcc 有其他选项可以帮助解决这个问题,例如,-Wtraditional。
复杂工具的开发者必须牢记兼容性。在类别之间移动选项保证会破坏某些人的构建脚本。比如gcc也有
`-Werror'
Make all warnings into errors.
有些人经常使用。不必要地打开开发人员之前选择不使用的警告并因此停止编译不是保持兼容性的方法。
有关-Wall 与-Wstrict-prototypes 的更多上下文,阅读整个 部分而不是选择性地挑选文本会有所帮助。例如,-Wall 的 current 文档的最后一段指出 -Wall 并不全面,最终包含的原因是一个判断问题(如原始文档中所示):
请注意,-Wall 并不暗示某些警告标志。其中一些警告用户通常不认为有问题但偶尔您可能希望检查的结构;其他人警告在某些情况下必须或难以避免的构造,并且没有简单的方法来修改代码以抑制警告。其中一些由 -Wextra 启用,但其中许多必须单独启用。
至于 的判断是——应该是 1990 年左右 gcc 的原始开发者。