NetBSD-Bugs archive

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

Re: lib/49429: Import strtonum(3)



On Dec 25,  5:52pm, n54%gmx.com@localhost ("Kamil Rytarowski") wrote:
-- Subject: Re: lib/49429: Import strtonum(3)

| --rehcsedm-93480b7d-80ff-48eb-8105-9ec241383b70
| Content-Type: text/plain; charset=UTF-8
| 
| Hello,
| 
| 1. Imported strtonum(3)
| 2. Adapted for NetBSD (libnbcompat...), man-page..
| 3. Dropped all occurrences of strtonum.c in our code-base
| 4. "Improved" strtonum(3) by changing its prototype to:
| intmax_t strtonum(char*,intmax_t,intmax_t,char**);
| 
| With this improvement we will remain almost fully source code compatible with OpenBSD, next inclusions of OpenBSD or FreeBSD code will be straight-forward.
| 
| 5. Exported strtonum(3) to user-space programs and making room for pkgsrc \o/
| 
| Please review and accept. Some things could be done probably cleaner like tmux.. but it's chicken-egg problem (import through pkgsrc to base...).
| 
| My changes were tested to build and produce valid sets, they are against NetBSD-current.

I propose instead to adopt a better interface:

    http://www.netbsd.org/~christos/strtoi.c

that does not suffer from the problems of strtonum(); for those who really
want strtonum(), we can supply it as a macro (or an inline to avoid gcc'isms)
that is hidden by default.

christos


Home | Main Index | Thread Index | Old Index