Clean up documentation of -Wsuggest-attribute= [PR115532]

The list of -Wsuggest-attribute= variants was out of date in the option
summary (and getting too long to fit on one line), and an index entry was
missing for -Wsuggest-attribute=returns_nonnull.

gcc/c-family/ChangeLog
	PR c/115532
	* c.opt.urls: Regenerated.

gcc/ChangeLog
	PR c/115532
	* common.opt.urls: Regenerated.
	* doc/invoke.texi (Option Summary): Don't try to list all the
	-Wsuggest-attribute= variants inline here.
	(Warning Options): Likewise.  Add @opindex for
	Wsuggest-attribute=returns_nonnull and its no- form.  Remove
	@itemx for no- form.

Co-Authored-By: Peter Eisentraut <peter@eisentraut.org>
This commit is contained in:
Sandra Loosemore 2024-12-12 19:56:04 +00:00
parent f7d1b9cdc0
commit c768cd07f8
3 changed files with 13 additions and 8 deletions

View file

@ -864,9 +864,6 @@ UrlSuffix(gcc/Warning-Options.html#index-Wno-system-headers)
Wtemplates
UrlSuffix(gcc/C_002b_002b-Dialect-Options.html#index-Wno-templates)
Wtautological-compare
UrlSuffix(gcc/Warning-Options.html#index-Wno-tautological-compare)
Wtemplate-body
UrlSuffix(gcc/C_002b_002b-Dialect-Options.html#index-Wno-template-body)

View file

@ -223,6 +223,9 @@ UrlSuffix(gcc/Warning-Options.html#index-Wno-suggest-attribute_003dnoreturn)
Wsuggest-attribute=malloc
UrlSuffix(gcc/Warning-Options.html#index-Wno-suggest-attribute_003dmalloc)
Wsuggest-attribute=returns_nonnull
UrlSuffix(gcc/Warning-Options.html#index-Wno-suggest-attribute_003dreturns_005fnonnull)
Wsuggest-final-types
UrlSuffix(gcc/C_002b_002b-Dialect-Options.html#index-Wno-suggest-final-types)
@ -235,6 +238,9 @@ UrlSuffix(gcc/Warning-Options.html#index-Wno-switch-unreachable)
Wsystem-headers
UrlSuffix(gcc/Warning-Options.html#index-Wno-system-headers)
Wtautological-compare
UrlSuffix(gcc/Warning-Options.html#index-Wno-tautological-compare)
Wtrampolines
UrlSuffix(gcc/Warning-Options.html#index-Wno-trampolines)

View file

@ -416,7 +416,7 @@ Objective-C and Objective-C++ Dialects}.
-Wstring-compare
-Wno-stringop-overflow -Wno-stringop-overread
-Wno-stringop-truncation -Wstrict-flex-arrays
-Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}malloc@r{]}
-Wsuggest-attribute=@var{attribute-name}
-Wswitch -Wno-switch-bool -Wswitch-default -Wswitch-enum
-Wno-switch-outside-range -Wno-switch-unreachable -Wsync-nand
-Wsystem-headers -Wtautological-compare -Wtrailing-whitespace
@ -8354,9 +8354,9 @@ even without optimization.
@opindex Wsuggest-attribute=
@opindex Wno-suggest-attribute=
@item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{|}cold@r{|}malloc@r{]}returns_nonnull@r{|}
@item -Wsuggest-attribute=@var{attribute-name}
Warn for cases where adding an attribute may be beneficial. The
attributes currently supported are listed below.
@var{attribute-name}s currently supported are listed below.
@table @gcctabopt
@opindex Wsuggest-attribute=pure
@ -8369,16 +8369,18 @@ attributes currently supported are listed below.
@opindex Wno-missing-noreturn
@opindex Wsuggest-attribute=malloc
@opindex Wno-suggest-attribute=malloc
@opindex Wsuggest-attribute=returns_nonnull
@opindex Wno-suggest-attribute=returns_nonnull
@item -Wsuggest-attribute=pure
@itemx -Wsuggest-attribute=const
@itemx -Wsuggest-attribute=noreturn
@itemx -Wmissing-noreturn
@itemx -Wsuggest-attribute=malloc
@itemx -Wsuggest-attribute=returns_nonnull
@itemx -Wno-suggest-attribute=returns_nonnull
Warn about functions that might be candidates for attributes
@code{pure}, @code{const}, @code{noreturn}, @code{malloc} or @code{returns_nonnull}. The compiler
@code{pure}, @code{const}, @code{noreturn}, @code{malloc} or
@code{returns_nonnull}. The compiler
only warns for functions visible in other compilation units or (in the case of
@code{pure} and @code{const}) if it cannot prove that the function returns
normally. A function returns normally if it doesn't contain an infinite loop or