All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Kevin Traynor <ktraynor@redhat.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	dev@dpdk.org, david.marchand@redhat.com, stable@dpdk.org,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Sivaprasad Tummala <sivaprasad.tummala@amd.com>
Subject: Re: [PATCH] examples/vm_power: fix format-truncation warning
Date: Tue, 17 Mar 2026 17:26:40 +0100	[thread overview]
Message-ID: <2781936.q0ZmV6gNhb@thomas> (raw)
In-Reply-To: <aa40bb29-8585-4f15-8909-2086b0fd0b08@redhat.com>

26/02/2026 11:48, Kevin Traynor:
> On 25/02/2026 18:32, Stephen Hemminger wrote:
> > On Wed, 25 Feb 2026 17:36:32 +0000
> > Kevin Traynor <ktraynor@redhat.com> wrote:
> > 
> >> Without libbsd-devel strlcpy is defined as rte_strlcpy and a warning is
> >> raised for format-truncation. Observed with gcc 15.2.1.
> >>
> >> In function ‘rte_strlcpy’,
> >>     inlined from ‘add_host_channels’ at
> >> ../examples/vm_power_manager/channel_manager.c:600:3:
> >> ../lib/eal/include/rte_string_fns.h:63:24:
> >> warning: ‘%s’ directive output may be truncated writing up to
> >> 4095 bytes into a region of size 108 [-Wformat-truncation=]
> >> 63 |         return (size_t)snprintf(dst, size, "%s", src);
> >>    |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>
> >> Check for truncation of socket_path[4096] into channel_path[108] to
> >> remove warning.
> >>
> >> Cc: stable@dpdk.org
> >>
> >> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> > 
> > Since socket_path is a unix domain socket path.
> > It should be UNIX_PATH_MAX (108) not PATH_MAX (4096)
> > 
> 
> Yeah, I had adjusted all the socket_path/names in the file to
> UNIX_PATH_MAX as an initial fix but it spewed a different truncation
> warning as one of them gets a copy from dirent->d_name which is 256.
> 
> So considering it's just an optimization of example code and hasn't
> really been developed over the last few years, I just fixed the warning
> that showed up.

Yes I suspect this example to have many other problems.
The whole example should be reconsidered.

Applied, thanks.




  reply	other threads:[~2026-03-17 16:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 17:36 [PATCH] examples/vm_power: fix format-truncation warning Kevin Traynor
2026-02-25 18:32 ` Stephen Hemminger
2026-02-26 10:48   ` Kevin Traynor
2026-03-17 16:26     ` Thomas Monjalon [this message]
2026-03-17 16:20 ` Thomas Monjalon

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=2781936.q0ZmV6gNhb@thomas \
    --to=thomas@monjalon.net \
    --cc=anatoly.burakov@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ktraynor@redhat.com \
    --cc=sivaprasad.tummala@amd.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.