]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Doc: -Wzero-as-null-pointer-constant is also available for C [PR119173]
authorMartin Uecker <uecker@tugraz.at>
Sun, 30 Mar 2025 11:07:24 +0000 (13:07 +0200)
committerMartin Uecker <uecker@gcc.gnu.org>
Tue, 1 Apr 2025 10:53:13 +0000 (12:53 +0200)
The warning -Wzero-as-null-pointer-constant is now not only supported
in C++ but also in C.  Change the documentation accordingly.

PR c/119173

gcc/ChangeLog:
* doc/invoke.texi (Warning Options): Move to general options.

gcc/doc/invoke.texi

index ab4867cc5947440f0dde824b8e66a6c73b57ca93..b1a0d9365b8635ad0524a0b581cead22566ca34d 100644 (file)
@@ -274,7 +274,7 @@ in the following sections.
 -Wsuggest-final-types  -Wsuggest-override  -Wno-template-body
 -Wno-template-id-cdtor  -Wtemplate-names-tu-local
 -Wno-terminate  -Wno-vexing-parse  -Wvirtual-inheritance
--Wno-virtual-move-assign  -Wvolatile  -Wzero-as-null-pointer-constant}
+-Wno-virtual-move-assign  -Wvolatile}
 
 @item Objective-C and Objective-C++ Language Options
 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
@@ -442,6 +442,7 @@ Objective-C and Objective-C++ Dialects}.
 -Wvla  -Wvla-larger-than=@var{byte-size}  -Wno-vla-larger-than
 -Wvolatile-register-var  -Wwrite-strings
 -Wno-xor-used-as-pow
+-Wzero-as-null-pointer-constant
 -Wzero-length-bounds}
 
 @item Static Analyzer Options
@@ -4690,11 +4691,6 @@ non-class type, @code{volatile}-qualified function return type,
 Enabled by default with @option{-std=c++20}.  Before
 @option{-std=c++20}, enabled with explicit @option{-Wdeprecated}.
 
-@opindex Wzero-as-null-pointer-constant
-@opindex Wno-zero-as-null-pointer-constant
-@item -Wzero-as-null-pointer-constant
-Warn when a literal @samp{0} is used as null pointer constant.
-
 @opindex Waligned-new
 @opindex Wno-aligned-new
 @item -Waligned-new
@@ -8920,6 +8916,11 @@ error alone, with @option{-Wno-error=int-conversion}.
 
 This warning is upgraded to an error by @option{-pedantic-errors}.
 
+@opindex Wzero-as-null-pointer-constant
+@opindex Wno-zero-as-null-pointer-constant
+@item -Wzero-as-null-pointer-constant
+Warn when a literal @samp{0} is used as null pointer constant.
+
 @opindex Wzero-length-bounds
 @opindex Wzero-length-bounds
 @item -Wzero-length-bounds