From 5eb86c29d29fa25f8ad81d75730a993bb03fb558 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 16 Sep 2025 19:25:58 +0200 Subject: [PATCH] docs: Adjust -Wimplicit-fallthrough= documentation for C23 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. 2025-09-16 Jakub Jelinek * doc/invoke.texi (Wimplicit-fallthrough=): Document that also C23 provides a standard way to suppress the warning with [[fallthrough]];. --- gcc/doc/invoke.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 3ffc8d8d4a2..3cf326cc22c 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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 provide 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 -- 2.47.3