linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: John Ogness <john.ogness@linutronix.de>
To: kernel test robot <lkp@intel.com>, Thomas Gleixner <tglx@linutronix.de>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Petr Mladek <pmladek@suse.com>
Subject: Re: [linux-next:master 5670/6619] kernel/printk/printk.c:2871:24: warning: array subscript 0 is outside array bounds of 'char[0]'
Date: Wed, 20 Sep 2023 12:16:50 +0206	[thread overview]
Message-ID: <87a5thtas5.fsf@jogness.linutronix.de> (raw)
In-Reply-To: <202309201724.M9BMAQIh-lkp@intel.com>

On 2023-09-20, kernel test robot <lkp@intel.com> wrote:
>    kernel/printk/printk.c: In function 'console_flush_all':
>>> kernel/printk/printk.c:2871:24: warning: array subscript 0 is outside array bounds of 'char[0]' [-Warray-bounds]
>     2871 |         char *outbuf = &printk_shared_pbufs.outbuf[0];
>          |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It is crazy all the things that get compiled in !CONFIG_PRINTK. We
definitely need to fix that after this rework.

As for this warning, anyone have anything against something like:

#ifdef CONFIG_PRINTK
static bool console_emit_next_record(struct console *con, bool *handover, int cookie)
{
   ... implementation ...
}
#else
static bool console_emit_next_record(struct console *con, bool *handover, int cookie)
{
        *handover = false;
        return false;
}
#endif

John


  reply	other threads:[~2023-09-20 10:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20  9:40 kernel test robot
2023-09-20 10:10 ` John Ogness [this message]
2023-09-20 11:11   ` Petr Mladek

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=87a5thtas5.fsf@jogness.linutronix.de \
    --to=john.ogness@linutronix.de \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pmladek@suse.com \
    --cc=tglx@linutronix.de \
    /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