DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: <dev@dpdk.org>
Subject: Re: [PATCH v5 1/3] cmdline: use C standard library as number parser
Date: Thu, 8 May 2025 08:27:41 +0100	[thread overview]
Message-ID: <aBxc7XgW1xUeiV-t@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <ec8528874aad76348f27c551289e1729b2fdcd25.1746631324.git.anatoly.burakov@intel.com>

On Wed, May 07, 2025 at 04:22:10PM +0100, Anatoly Burakov wrote:
> Remove custom number parser and use C standard library instead. In order to
> keep compatibility with earlier versions of the parser, we have to take
> into account a few quirks:
> 
> - We do not consider "negative" numbers to be valid for anything other than
>   base-10 numbers, whereas C standard library does. We work around that by
>   forcing base-10 when parsing numbers we expect to be negative.

Is it likely to break much in the way of compatibility if we start allowing
negative non-base-10 numbers? If it simplifies our code to allow it, I'd
tend towards doing so unless there is a known case where it might cause
problems.

/Bruce

> - We do not consider numbers such as "+4" to be valid, whereas C standard
>   library does. No one probably relies on this, so we just remove it from
>   our tests, as it is now a valid number.
> - C standard library's strtoull does not do range checks on negative
>   numbers, so we have to parse knowingly-negative numbers as signed. We've
>   already changed this to be the case on account of point 1 from this list,
>   so no biggie.
> - C standard library does not support binary numbers, so we keep around the
>   relevant parts of the custom parser in place to support binary numbers.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---

<snip>

  parent reply	other threads:[~2025-05-08  7:28 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-02 12:27 [PATCH v1 1/1] app/testpmd: add sleep command Anatoly Burakov
2025-05-02 12:37 ` Bruce Richardson
2025-05-02 14:35   ` Burakov, Anatoly
2025-05-02 14:43     ` Bruce Richardson
2025-05-02 15:33       ` Morten Brørup
2025-05-02 15:42 ` Stephen Hemminger
2025-05-06 12:36   ` Burakov, Anatoly
2025-05-06 13:08 ` [PATCH v2 1/2] cmdline: add floating point support Anatoly Burakov
2025-05-06 13:08   ` [PATCH v2 2/2] app/testpmd: add sleep command Anatoly Burakov
2025-05-06 13:38   ` [PATCH v2 1/2] cmdline: add floating point support Bruce Richardson
2025-05-07  9:02     ` Burakov, Anatoly
2025-05-07  9:50 ` [PATCH v3 " Anatoly Burakov
2025-05-07  9:50   ` [PATCH v3 2/2] app/testpmd: add sleep command Anatoly Burakov
2025-05-07  9:53   ` [PATCH v3 1/2] cmdline: add floating point support Burakov, Anatoly
2025-05-07 10:01 ` [PATCH v4 " Anatoly Burakov
2025-05-07 10:01   ` [PATCH v4 2/2] app/testpmd: add sleep command Anatoly Burakov
2025-05-07 10:35   ` [PATCH v4 1/2] cmdline: add floating point support Konstantin Ananyev
2025-05-07 11:06     ` Burakov, Anatoly
2025-05-07 12:24       ` Konstantin Ananyev
2025-05-07 14:06         ` Burakov, Anatoly
2025-05-07 15:22 ` [PATCH v5 1/3] cmdline: use C standard library as number parser Anatoly Burakov
2025-05-07 15:22   ` [PATCH v5 2/3] cmdline: add floating point support Anatoly Burakov
2025-05-07 15:22   ` [PATCH v5 3/3] app/testpmd: add sleep command Anatoly Burakov
2025-05-08  7:27   ` Bruce Richardson [this message]
2025-05-08  8:35     ` [PATCH v5 1/3] cmdline: use C standard library as number parser Burakov, Anatoly
2025-05-08  9:53 ` [PATCH v6 " Anatoly Burakov
2025-05-08  9:53   ` [PATCH v6 2/3] cmdline: add floating point support Anatoly Burakov
2025-05-08  9:53   ` [PATCH v6 3/3] app/testpmd: add sleep command Anatoly Burakov
2025-05-08 10:01 ` [PATCH v7 1/3] cmdline: use C standard library as number parser Anatoly Burakov
2025-05-08 10:01   ` [PATCH v7 2/3] cmdline: add floating point support Anatoly Burakov
2025-05-08 10:09     ` Burakov, Anatoly
2025-05-08 10:01   ` [PATCH v7 3/3] app/testpmd: add sleep command Anatoly Burakov
2025-05-08 13:16 ` [PATCH v8 1/3] cmdline: use C standard library as number parser Anatoly Burakov
2025-05-08 13:16   ` [PATCH v8 2/3] cmdline: add floating point support Anatoly Burakov
2025-05-08 13:16   ` [PATCH v8 3/3] app/testpmd: add sleep command Anatoly Burakov
2025-05-09 13:02   ` [PATCH v8 1/3] cmdline: use C standard library as number parser Burakov, Anatoly
2025-05-09 13:08     ` Burakov, Anatoly
2025-05-09 13:27       ` Burakov, Anatoly
2025-05-09 13:39 ` [PATCH v9 " Anatoly Burakov
2025-05-09 13:39   ` [PATCH v9 2/3] cmdline: add floating point support Anatoly Burakov
2025-05-09 13:39   ` [PATCH v9 3/3] app/testpmd: add sleep command Anatoly Burakov
2025-05-09 13:42   ` [PATCH v9 1/3] cmdline: use C standard library as number parser Burakov, Anatoly
2025-05-09 14:41 ` [PATCH v10 " Anatoly Burakov
2025-05-09 14:41   ` [PATCH v10 2/3] cmdline: add floating point support Anatoly Burakov
2025-05-09 14:41   ` [PATCH v10 3/3] app/testpmd: add sleep command Anatoly Burakov

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=aBxc7XgW1xUeiV-t@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.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;
as well as URLs for NNTP newsgroup(s).