This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH doc] Explain options precedence and difference between -pedantic-errors and -Werror=pedantic


While writing the guidelines
https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines , I noticed
that we never explain the precedence rules between conflicting
options. Also, the description of -pedantic-errors could be more
precise.

OK?


Index: invoke.texi
===================================================================
--- invoke.texi    (revision 215973)
+++ invoke.texi    (working copy)
@@ -3263,6 +3263,15 @@
 language-specific options also refer to @ref{C++ Dialect Options} and
 @ref{Objective-C and Objective-C++ Dialect Options}.

+Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
+options, such as @option{-Wunused}, which may turn on further options,
+such as @option{-Wunused-value}. The combined effect of positive and
+negative forms is that more specific options have priority over less
+specific ones, independently of their position in the command-line. For
+options of the same specificity, the last one takes effect. Options
+enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
+as if they appeared at the end of the command-line.
+
 When an unrecognized warning option is requested (e.g.,
 @option{-Wunknown-warning}), GCC emits a diagnostic stating
 that the option is not recognized.  However, if the @option{-Wno-} form
@@ -3318,8 +3327,8 @@

 @item -pedantic-errors
 @opindex pedantic-errors
-Like @option{-Wpedantic}, except that errors are produced rather than
-warnings.
+This is equivalent to @option{-Werror=pedantic} plus making into errors
+a few warnings that are not controlled by @option{-Wpedantic}.

 @item -Wall
 @opindex Wall


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]