Change in libosmocore[master]: revisit some calls of strtol(), stroul(), strtoull()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Mon Sep 6 16:22:36 UTC 2021


neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/25347 )

Change subject: revisit some calls of strtol(), stroul(), strtoull()
......................................................................


Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/c/libosmocore/+/25347/4/src/gsm/gsm23236.c 
File src/gsm/gsm23236.c:

https://gerrit.osmocom.org/c/libosmocore/+/25347/4/src/gsm/gsm23236.c@443 
PS4, Line 443: 	if (osmo_str_to_int(&val, str, base, 0, INT16_MAX))
> Sure, and we could also use strtoll directly ;) […]
The point is that strtoll() is not trivial to use,
and every time we do it is a dozen lines of pitfalls.

in practice we don't need to parse past int64_t range; that range is HUUGE.
if we really do we can add a uint API for that, or use strtoul following the example of the implementation of osmo_str_to_int64().

When parsing a number ranged 0-999 there is no benefit of an unsigned function over a signed one.

I'm sorry but I'm not really getting your point it seems?



-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/25347
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0ebb06e751c28f7d1cdf328de29cd227a2449391
Gerrit-Change-Number: 25347
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Mon, 06 Sep 2021 16:22:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr at sysmocom.de>
Comment-In-Reply-To: pespin <pespin at sysmocom.de>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210906/6d7b0ea9/attachment.htm>


More information about the gerrit-log mailing list