public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, thomas@monjalon.net, 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: Thu, 26 Feb 2026 10:48:30 +0000	[thread overview]
Message-ID: <aa40bb29-8585-4f15-8909-2086b0fd0b08@redhat.com> (raw)
In-Reply-To: <20260225103251.37c715f4@phoenix.local>

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.


  reply	other threads:[~2026-02-26 10:48 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 [this message]
2026-03-17 16:26     ` Thomas Monjalon
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=aa40bb29-8585-4f15-8909-2086b0fd0b08@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=sivaprasad.tummala@amd.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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