The manual documents the -Wno-missing-attributes form of the option as if it was enabled by default, even though it's enabled by -Wall (I can't get this -Wno- convention straight in my head). I also got private comments on the documentation of the option suggesting to add cross-references, and to list the attributes -Wattribute-alias considers (the same ones as -Wmissing-attributes).
The attached patch makes these changes. Martin
gcc/ChangeLog: * doc/invoke.texi (-Wmissing-attributes): Invert entry. Add cross-references. (-Wattribute-alias): Mention considered attributes (same as for -Wmissing-attributes). Index: gcc/doc/invoke.texi =================================================================== --- gcc/doc/invoke.texi (revision 268583) +++ gcc/doc/invoke.texi (working copy) @@ -5055,10 +5055,10 @@ about the layout of the file that the directive re This warning is enabled by @option{-Wall} in C and C++. -@item -Wno-missing-attributes +@item -Wmissing-attributes @opindex Wmissing-attributes @opindex Wno-missing-attributes -Warn when a declaration of a function is missing one or more attributes +Do not warn when a declaration of a function is missing one or more attributes that a related function is declared with and whose absence may adversely affect the correctness or efficiency of generated code. For example, the warning is issued for declarations of aliases that use attributes @@ -5079,6 +5079,11 @@ or @code{nonnull} is declared without it. Attribu @code{error}, and @code{warning} suppress the warning. (@pxref{Function Attributes}). +The the @code{copy} attribute provides a mechanism for applying the same +set of attributes to a declaration as that on another declaration without +explicitly enumerating the attributes. (@pxref{Function Attributes}. +@pxref{Variable Attributes}. @pxref{Variable Attributes}.) + @option{-Wmissing-attributes} is enabled by @option{-Wall}. For example, since the declaration of the primary function template @@ -6101,9 +6106,14 @@ false positives and is deactivated by default. @opindex -Wattribute-alias @opindex -Wno-attribute-alias Warn about declarations using the @code{alias} and similar attributes whose -target is incompatible with the type of the alias. +target is incompatible with the type of the alias. Attributes considered +include @code{alloc_align}, @code{alloc_size}, @code{cold}, @code{const}, +@code{hot}, @code{leaf}, @code{malloc}, @code{nonnull}, @code{noreturn}, +@code{nothrow}, @code{pure}, @code{returns_nonnull}, and @code{returns_twice}. + @xref{Function Attributes,,Declaring Attributes of Functions}. -The @option{-Wattribute-alias=1} is enabled by @option{-Wall}. +The @option{-Wattribute-alias=1} option is enabled by @option{-Wall}. +See also the related @option{-Wmissing-attributes} option. @table @gcctabopt @item -Wattribute-alias=1