From: Sandra Loosemore <sandra@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Subject: [COMMITTED] Correct lists of options enabled by -Wall and -Wextra [PR90463]
Date: Mon, 22 Jan 2024 17:26:50 -0700 [thread overview]
Message-ID: <20240123002650.1567390-2-sandra@codesourcery.com> (raw)
In-Reply-To: <20240123002650.1567390-1-sandra@codesourcery.com>
gcc/ChangeLog
PR c++/90463
* doc/invoke.texi (Warning Options): Correct lists of options
enabled by -Wall and -Wextra by checking against common.opt
and c-family/c.opt.
---
gcc/doc/invoke.texi | 79 ++++++++++++++++++++++++++++-----------------
1 file changed, 50 insertions(+), 29 deletions(-)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 278c931b6a3..676e7ef03d1 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -6202,27 +6202,37 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
@option{-Wall} turns on the following warning flags:
@gccoptlist{-Waddress
+-Waligned-new @r{(C++ and Objective-C++ only)}
-Warray-bounds=1 @r{(only with} @option{-O2}@r{)}
-Warray-compare
--Warray-parameter=2 @r{(C and Objective-C only)}
+-Warray-parameter=2
-Wbool-compare
-Wbool-operation
--Wc++11-compat -Wc++14-compat
+-Wc++11-compat -Wc++14-compat -Wc++17compat -Wc++20compat
-Wcatch-value @r{(C++ and Objective-C++ only)}
-Wchar-subscripts
+-Wclass-memaccess @r{(C++ and Objective-C++ only)}
-Wcomment
+-Wdangling-else
-Wdangling-pointer=2
+-Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
-Wduplicate-decl-specifier @r{(C and Objective-C only)}
-Wenum-compare @r{(in C/ObjC; this is on by default in C++)}
-Wenum-int-mismatch @r{(C and Objective-C only)}
--Wformat
--Wformat-overflow
--Wformat-truncation
--Wint-in-bool-context
+-Wformat=1
+-Wformat-contains-nul
+-Wformat-diag
+-Wformat-extra-args
+-Wformat-overflow=1
+-Wformat-truncation=1
+-Wformat-zero-length
+-Wframe-address
-Wimplicit @r{(C and Objective-C only)}
--Wimplicit-int @r{(C and Objective-C only)}
-Wimplicit-function-declaration @r{(C and Objective-C only)}
--Winit-self @r{(only for C++)}
+-Wimplicit-int @r{(C and Objective-C only)}
+-Winfinite-recursion
+-Winit-self @r{(C++ and Objective-C++ only)}
+-Wint-in-bool-context
-Wlogical-not-parentheses
-Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}
-Wmaybe-uninitialized
@@ -6230,24 +6240,26 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
-Wmemset-transposed-args
-Wmisleading-indentation @r{(only for C/C++)}
-Wmismatched-dealloc
--Wmismatched-new-delete @r{(only for C/C++)}
+-Wmismatched-new-delete @r{(C++ and Objective-C++ only)}
-Wmissing-attributes
-Wmissing-braces @r{(only for C/ObjC)}
-Wmultistatement-macros
--Wnarrowing @r{(only for C++)}
+-Wnarrowing @r{(C++ and Objective-C++ only)}
-Wnonnull
-Wnonnull-compare
--Wopenmp-simd
+-Wopenmp-simd @r{(C and C++ only)}
+-Woverloaded-virtual=1 @r{(C++ and Objective-C++ only)}
+-Wpacked-not-aligned
-Wparentheses
--Wpessimizing-move @r{(only for C++)}
--Wpointer-sign
--Wrange-loop-construct @r{(only for C++)}
--Wreorder
+-Wpessimizing-move @r{(C++ and Objective-C++ only)}
+-Wpointer-sign @r{(only for C/ObjC)}
+-Wrange-loop-construct @r{(C++ and Objective-C++ only)}
+-Wreorder @r{(C++ and Objective-C++ only)}
-Wrestrict
-Wreturn-type
--Wself-move @r{(only for C++)}
+-Wself-move @r{(C++ and Objective-C++ only)}
-Wsequence-point
--Wsign-compare @r{(only in C++)}
+-Wsign-compare @r{(C++ and Objective-C++ only)}
-Wsizeof-array-div
-Wsizeof-pointer-div
-Wsizeof-pointer-memaccess
@@ -6258,12 +6270,16 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
-Wtrigraphs
-Wuninitialized
-Wunknown-pragmas
+-Wunused
+-Wunused-but-set-variable
+-Wunused-const-variable=1 @r{(only for C/ObjC)}
-Wunused-function
-Wunused-label
+-Wunused-local-typedefs
-Wunused-value
-Wunused-variable
-Wuse-after-free=2
--Wvla-parameter @r{(C and Objective-C only)}
+-Wvla-parameter
-Wvolatile-register-var
-Wzero-length-bounds}
@@ -6283,27 +6299,32 @@ This enables some extra warning flags that are not enabled by
@option{-Wall}. (This option used to be called @option{-W}. The older
name is still supported, but the newer name is more descriptive.)
-@gccoptlist{-Wclobbered
+@gccoptlist{-Wabsolute-value @r{(only for C/ObjC)}
+-Walloc-size
+-Wcalloc-transposed-args
-Wcast-function-type
--Wdeprecated-copy @r{(C++ only)}
+-Wclobbered
+-Wdeprecated-copy @r{(C++ and Objective-C++ only)}
-Wempty-body
--Wenum-conversion @r{(C only)}
--Wignored-qualifiers
+-Wenum-conversion @r{(only for C/ObjC)}
+-Wexpansion-to-defined
+-Wignored-qualifiers @r{(only for C/C++)}
-Wimplicit-fallthrough=3
+-Wmaybe-uninitialized
-Wmissing-field-initializers
--Wmissing-parameter-type @r{(C only)}
--Wold-style-declaration @r{(C only)}
--Woverride-init
--Wsign-compare @r{(C only)}
+-Wmissing-parameter-type @r{(C/ObjC only)}
+-Wold-style-declaration @r{(C/ObjC only)}
+-Woverride-init @r{(C/ObjC only)}
+-Wredundant-move @r{(C++ and Objective-C++ only)}
+-Wshift-negative-value @r{(in C++11 to C++17 and in C99 and newer)}
+-Wsign-compare @r{(C++ and Objective-C++ only)}
+-Wsized-deallocation @r{(C++ and Objective-C++ only)}
-Wstring-compare
--Wredundant-move @r{(only for C++)}
-Wtype-limits
-Wuninitialized
--Wshift-negative-value @r{(in C++11 to C++17 and in C99 and newer)}
-Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}
-Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}}
-
The option @option{-Wextra} also prints warning messages for the
following cases:
--
2.31.1
prev parent reply other threads:[~2024-01-23 0:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-23 0:26 [COMMITTED, obvious] Sort warning options in c-family/c.opt Sandra Loosemore
2024-01-23 0:26 ` Sandra Loosemore [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240123002650.1567390-2-sandra@codesourcery.com \
--to=sandra@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).