docs: Adjust -Wimplicit-fallthrough= documentation for C23

Message ID aMh/iJmck++chmF3@tucnak
State New
Headers
Series docs: Adjust -Wimplicit-fallthrough= documentation for C23 |

Commit Message

Jakub Jelinek Sept. 15, 2025, 9:05 p.m. UTC
  Hi!

I've noticed in -Wimplicit-fallthrough= documentation we talk about
[[fallthrough]]; for C++17 but don't mention that it is also standard
way to suppress the warning for C23.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2025-09-15  Jakub Jelinek  <jakub@redhat.com>

	* doc/invoke.texi (Wimplicit-fallthrough=): Document that also C23
	provides a standard way to supress the warning with [[fallthrough]];.


	Jakub
  

Comments

Marek Polacek Sept. 15, 2025, 9:13 p.m. UTC | #1
On Mon, Sep 15, 2025 at 11:05:12PM +0200, Jakub Jelinek wrote:
> Hi!
> 
> I've noticed in -Wimplicit-fallthrough= documentation we talk about
> [[fallthrough]]; for C++17 but don't mention that it is also standard
> way to suppress the warning for C23.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> 2025-09-15  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* doc/invoke.texi (Wimplicit-fallthrough=): Document that also C23
> 	provides a standard way to supress the warning with [[fallthrough]];.

s/supress/suppress/

> --- gcc/doc/invoke.texi.jj	2025-09-15 11:47:03.435955271 +0200
> +++ gcc/doc/invoke.texi	2025-09-15 16:26:17.085714262 +0200
> @@ -7410,7 +7410,7 @@ switch (cond)
>  @end group
>  @end smallexample
>  
> -C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
> +C++17 and C23 provides a standard way to suppress the @option{-Wimplicit-fallthrough}

I suppose "provide" is better here now that we're talking about multiple languages.

Ok if you agree, thanks.

>  warning using @code{[[fallthrough]];} instead of the GNU attribute.  In C++11
>  or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension.
>  Instead of these attributes, it is also possible to add a fallthrough comment

Marek
  

Patch

--- gcc/doc/invoke.texi.jj	2025-09-15 11:47:03.435955271 +0200
+++ gcc/doc/invoke.texi	2025-09-15 16:26:17.085714262 +0200
@@ -7410,7 +7410,7 @@  switch (cond)
 @end group
 @end smallexample
 
-C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
+C++17 and C23 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
 warning using @code{[[fallthrough]];} instead of the GNU attribute.  In C++11
 or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension.
 Instead of these attributes, it is also possible to add a fallthrough comment