NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

misc/59199: nullability of rstatus parameter in strtoi(3) and strtou(3)



>Number:         59199
>Category:       misc
>Synopsis:       nullability of rstatus parameter in strtoi(3) and strtou(3)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 19 23:45:00 +0000 2025
>Originator:     Alejandro Colomar
>Release:        10.1
>Organization:
Linux man-pages project, C Committee (WG14), shadow-utils
>Environment:
>Description:
There seem to be exactly zero callers of these APIs that are not interested in the status, in NetBSD.

alx@devuan:~/src/bsd/netbsd/trunk$ find -type f \
    | grep '\.[ch]$' \
    | xargs grep -l '\<strto[iu]\>' \
    | xargs pcre2grep -Mn '(?s)\bstrto[iu] *\([^;]*(NULL|0)\)';
alx@devuan:~/src/bsd/netbsd/trunk$


In Debian, there seems to be one, but it's a test case, so I guess we can just talk to them and ask them to update the test.

<https://codesearch.debian.net/search?q=%5Cbstrto%5Bui%5D+*%5C%28.*NULL%5C%29&literal=0>

The main point of this API is that it simplifies error handling compared to strtol(3).  But if one doesn't care about errors, strtol is just as good.  (Well, the clamping behavior is nice, but I think it really makes little sense to not check for errors, and it seems everybody else agrees?)

I don't have a strong opinion, but what do you think?
>How-To-Repeat:

>Fix:
Require status to be non-null for strtoi(3) and strtou(3).



Home | Main Index | Thread Index | Old Index