From: Stephen Hemminger <stephen@networkplumber.org>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: dev@dpdk.org, Guillaume Gardet <Guillaume.Gardet@arm.com>,
Anatoly Burakov <anatoly.burakov@intel.com>,
Sivaprasad Tummala <sivaprasad.tummala@amd.com>,
Lee Daly <lee.daly@intel.com>,
Marcin Hajkowski <marcinx.hajkowski@intel.com>
Subject: Re: [PATCH RESEND] examples/vm_power_manager: add missing <stdlib.h> header include for strtol
Date: Fri, 28 Aug 2026 15:18:33 -0700 [thread overview]
Message-ID: <20260828151833.1d4e92d0@phoenix.local> (raw)
In-Reply-To: <20260828215350.2861715-1-thomas.petazzoni@bootlin.com>
On Fri, 28 Aug 2026 23:53:50 +0200
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> From: Guillaume Gardet <Guillaume.Gardet@arm.com>
>
> strtol is defined in stdlib.h
>
> Fixes the following build failure:
>
> ../examples/vm_power_manager/guest_cli/vm_power_cli_guest.c: In function ‘cmd_query_freq_list_parsed’:
> ../examples/vm_power_manager/guest_cli/vm_power_cli_guest.c:208:42: error: implicit declaration of function ‘strtol’; did you mean ‘strtok’? [-Wimplicit-function-declaration]
> 208 | lcore_id = (unsigned int)strtol(res->cpu_num, &ep, 10);
> | ^~~~~~
> | strtok
>
> Fixes: 0e8f47491f090f44a4956429cb27f6942b6618b0 ("examples/vm_power: add command to query CPU frequency")
> Signed-off-by: Guillaume Gardet <guillaume.gardet@arm.com>
> [Thomas:
> - retrieve patch from
> https://build.opensuse.org/projects/openSUSE:42:Factory-Candidates-Check/packages/dpdk/files/0001-examples-vm_power_manager-add-missing-header.patch?expand=1
> - improve commit message]
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> examples/vm_power_manager/guest_cli/vm_power_cli_guest.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
> index 4114593cee..63a59c8b10 100644
> --- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
> +++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
> @@ -6,6 +6,7 @@
> #include <stdint.h>
> #include <string.h>
> #include <stdio.h>
> +#include <stdlib.h>
> #include <termios.h>
>
> #include <cmdline_rdline.h>
There is a pre-existing bug here. strtol() can returned signed value.
Probably should be using strtoul
next prev parent reply other threads:[~2026-08-28 22:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 21:53 [PATCH RESEND] examples/vm_power_manager: add missing <stdlib.h> header include for strtol Thomas Petazzoni
2026-08-28 22:18 ` Stephen Hemminger [this message]
2026-08-29 2:43 ` [PATCH 1/2] examples/vm_power_manager: fix includes Stephen Hemminger
2026-08-29 2:43 ` [PATCH 2/2] examples/vm_power_manager: fix vCPU number parsing Stephen Hemminger
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=20260828151833.1d4e92d0@phoenix.local \
--to=stephen@networkplumber.org \
--cc=Guillaume.Gardet@arm.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=lee.daly@intel.com \
--cc=marcinx.hajkowski@intel.com \
--cc=sivaprasad.tummala@amd.com \
--cc=thomas.petazzoni@bootlin.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