public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: MIshraMohit21-LE <mishraloopmohit@gmail.com>,
	mohit.mishra@lunaredgeit.com
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Kees Cook <keescook@chromium.org>,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH] Makefile: Globally enable fall-through warning
Date: Sat, 10 Jan 2026 12:12:56 +0900	[thread overview]
Message-ID: <d91d137e-a9a4-4b91-a759-62054b53bd44@embeddedor.com> (raw)
In-Reply-To: <20260110013412.14426-2-mohit.mishra@lunaredgeit.com>

Are you intentionally spamming us?

-Gustavo

On 1/10/26 10:34, MIshraMohit21-LE wrote:
> From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
> 
> Now that all the fall-through warnings have been addressed in the
> kernel, enable the fall-through warning globally.
> 
> Also, update the deprecated.rst file to include implicit fall-through
> as 'deprecated' so people can be pointed to a single location for
> justification.
> 
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: linux-kbuild@vger.kernel.org
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
> ---
>   Documentation/process/deprecated.rst | 14 ++++++++++++++
>   Makefile                             |  3 +++
>   2 files changed, 17 insertions(+)
> 
> diff --git a/Documentation/process/deprecated.rst b/Documentation/process/deprecated.rst
> index 49e0f64a3427..053b24a6dd38 100644
> --- a/Documentation/process/deprecated.rst
> +++ b/Documentation/process/deprecated.rst
> @@ -119,3 +119,17 @@ array may exceed the remaining memory in the stack segment. This could
>   lead to a crash, possible overwriting sensitive contents at the end of the
>   stack (when built without `CONFIG_THREAD_INFO_IN_TASK=y`), or overwriting
>   memory adjacent to the stack (when built without `CONFIG_VMAP_STACK=y`)
> +
> +Implicit switch case fall-through
> +---------------------------------
> +The C language allows switch cases to "fall through" when
> +a "break" statement is missing at the end of a case. This,
> +however, introduces ambiguity in the code, as it's not always
> +clear if the missing break is intentional or a bug. As there
> +have been a long list of flaws `due to missing "break" statements
> +<https://cwe.mitre.org/data/definitions/484.html>`_, we no longer allow
> +"implicit fall-through". In order to identify an intentional fall-through
> +case, we have adopted the marking used by static analyzers: a comment
> +saying `/* Fall through */`. Once the C++17 `__attribute__((fallthrough))`
> +is more widely handled by C compilers, static analyzers, and IDEs, we can
> +switch to using that instead.
> diff --git a/Makefile b/Makefile
> index 9be5834073f8..bdf8eac51b07 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -843,6 +843,9 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
>   # warn about C99 declaration after statement
>   KBUILD_CFLAGS += -Wdeclaration-after-statement
>   
> +# Warn about unmarked fall-throughs in switch statement.
> +KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough=3,)
> +
>   # Variable Length Arrays (VLAs) should not be used anywhere in the kernel
>   KBUILD_CFLAGS += -Wvla
>   


  reply	other threads:[~2026-01-10  3:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-10  1:34 [PATCH] Makefile: Globally enable fall-through warning MIshraMohit21-LE
2026-01-10  3:12 ` Gustavo A. R. Silva [this message]
     [not found]   ` <CAP5HdgoFya1NfeJH0wT7KtzqaFmupn5C-kSwXNEtEdbq5bQSEw@mail.gmail.com>
2026-01-10  4:04     ` Gustavo A. R. Silva
  -- strict thread matches above, loose matches on Subject: below --
2026-02-14  9:19 Rishabh
     [not found] <20260131054051.6938-1-david@stennet.com>
2026-01-31  5:40 ` david
2026-01-31  5:33   ` Gustavo A. R. Silva
2026-01-22 15:53 Simone Rea
2026-01-22 18:19 ` Randy Dunlap
2026-01-22 18:44   ` Andrew Morton
2026-01-22 18:46     ` Randy Dunlap
2026-01-22 22:35       ` Miguel Ojeda
     [not found]       ` <CAEfWggNK7DgsRHXTE8BhWCTuDKyt6pMR_9UEHEs1NKPfPPyopw@mail.gmail.com>
2026-01-23  1:51         ` Gustavo A. R. Silva
2025-05-05 17:14 Omar el Azouny
2025-05-05 17:53 ` Miguel Ojeda
2022-05-17 17:35 ALOK JHA
2022-05-17 18:42 ` Andrew Morton
2022-05-17 18:46 ` Andrew Morton
2022-05-17 19:40   ` Jeff Johnson
2022-05-17 19:59   ` Gustavo A. R. Silva

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=d91d137e-a9a4-4b91-a759-62054b53bd44@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=mishraloopmohit@gmail.com \
    --cc=mohit.mishra@lunaredgeit.com \
    --cc=yamada.masahiro@socionext.com \
    /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