From: Sunil V L <sunilvl@ventanamicro.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: kernel test robot <lkp@intel.com>,
oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Palmer Dabbelt <palmer@rivosinc.com>,
Andrew Jones <ajones@ventanamicro.com>,
Conor Dooley <conor.dooley@microchip.com>
Subject: Re: drivers/pnp/pnpacpi/core.c:253:17: warning: 'strncpy' specified bound 50 equals destination size
Date: Tue, 25 Jul 2023 10:38:03 +0530 [thread overview]
Message-ID: <ZL9Ys8DKf7RKg20G@sunil-laptop> (raw)
In-Reply-To: <CAJZ5v0gyGeier-Oz=o59TY1XzuPfZ02K=D6F-bMfJbXJ_5OnBA@mail.gmail.com>
On Mon, Jul 24, 2023 at 07:15:22PM +0200, Rafael J. Wysocki wrote:
> On Mon, Jul 24, 2023 at 4:20 PM Sunil V L <sunilvl@ventanamicro.com> wrote:
> >
> > +Rafael.
> >
> > On Mon, Jul 24, 2023 at 07:32:36PM +0800, kernel test robot wrote:
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > > head: 6eaae198076080886b9e7d57f4ae06fa782f90ef
> > > commit: a91a9ffbd3a55a0ae1bb75e2b6e85b2a03f64e8f RISC-V: Add support to build the ACPI core
> > > date: 8 weeks ago
> > > config: riscv-randconfig-r032-20230724 (https://download.01.org/0day-ci/archive/20230724/202307241942.Rff2Nri5-lkp@intel.com/config)
> > > compiler: riscv64-linux-gcc (GCC) 12.3.0
> > > reproduce: (https://download.01.org/0day-ci/archive/20230724/202307241942.Rff2Nri5-lkp@intel.com/reproduce)
> > >
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <lkp@intel.com>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/202307241942.Rff2Nri5-lkp@intel.com/
> > >
> > > All warnings (new ones prefixed by >>):
> > >
> > > drivers/pnp/pnpacpi/core.c: In function 'pnpacpi_add_device.isra':
> > > >> drivers/pnp/pnpacpi/core.c:253:17: warning: 'strncpy' specified bound 50 equals destination size [-Wstringop-truncation]
> > > 253 | strncpy(dev->name, acpi_device_name(device), sizeof(dev->name));
> > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >
> > I need some help here to understand what needs to be done. This is a
> > common code across architectures. Apart from the fact that ACPI is
> > enabled for the first time for RISC-V, I am unable to understand why
> > this warning is seen now. Is this because only RISC-V gcc enables this
> > warning by default? I don't see this with clang tool chain. If this is
> > expected warning, is there a way to suppress?
>
> I think that this is relevant information:
>
> https://stackoverflow.com/questions/50198319/gcc-8-wstringop-truncation-what-is-the-good-practice
>
Thank you very much! Rafael. Let me send a patch to append a NUL
explicitly to fix this issue. However, I still wonder why this code
added in 2005 getting this warning only now. Why is this not being seen
with other architecture builds?
Thanks!
Sunil
next prev parent reply other threads:[~2023-07-25 5:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 11:32 kernel test robot
2023-07-24 14:20 ` Sunil V L
2023-07-24 17:15 ` Rafael J. Wysocki
2023-07-25 5:08 ` Sunil V L [this message]
2023-07-25 8:51 ` Rafael J. Wysocki
-- strict thread matches above, loose matches on Subject: below --
2023-07-10 6:25 [PATCH V6 6/6] coresight: etm4x: Add ACPI support in platform driver Anshuman Khandual
2023-07-26 14:05 ` drivers/pnp/pnpacpi/core.c:253:17: warning: 'strncpy' specified bound 50 equals destination size Suzuki K Poulose
2023-07-26 14:58 ` Sudeep Holla
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=ZL9Ys8DKf7RKg20G@sunil-laptop \
--to=sunilvl@ventanamicro.com \
--cc=ajones@ventanamicro.com \
--cc=conor.dooley@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=palmer@rivosinc.com \
--cc=rafael@kernel.org \
/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
all inboxes | Powered by JetHome®