diff options
author | Sandra Loosemore <sloosemore@baylibre.com> | 2024-12-12 19:56:04 +0000 |
---|---|---|
committer | Sandra Loosemore <sloosemore@baylibre.com> | 2024-12-12 20:17:15 +0000 |
commit | c768cd07f8d96175e66c25f541d3d58569cf6397 (patch) | |
tree | 402ce9aebc438a13c63f7c60dc15250967f369ac /gcc | |
parent | f7d1b9cdc0dd811722798530efffd736bfc2bc1d (diff) | |
download | gcc-c768cd07f8d96175e66c25f541d3d58569cf6397.zip gcc-c768cd07f8d96175e66c25f541d3d58569cf6397.tar.gz gcc-c768cd07f8d96175e66c25f541d3d58569cf6397.tar.bz2 |
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>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/c.opt.urls | 3 | ||||
-rw-r--r-- | gcc/common.opt.urls | 6 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 12 |
3 files changed, 13 insertions, 8 deletions
diff --git a/gcc/c-family/c.opt.urls b/gcc/c-family/c.opt.urls index 8fbe3bd..6c08b0a 100644 --- a/gcc/c-family/c.opt.urls +++ b/gcc/c-family/c.opt.urls @@ -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) diff --git a/gcc/common.opt.urls b/gcc/common.opt.urls index 773c021..577e00d 100644 --- a/gcc/common.opt.urls +++ b/gcc/common.opt.urls @@ -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) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index b850844..67a3c8f 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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 |