[VODZ] hickup with strtoll() and vasprintf()

walter harms wharms at bfs.de
Wed May 10 15:57:19 UTC 2006



that strtoll() is missing i would call a bug.

The better way would testing the system for critical stuff like gnu 
extensions (aka autoconfig) and provide the missing pieces.


Bernhard Fischer wrote:
> On Wed, May 10, 2006 at 03:55:34PM +0200, walter harms wrote:
>> The only way to make bb work will be providing your own copy of 
>> (v)asprintf and strtoll.
>>
>> a quick look at bb (oder copy) shows strtoll in ash.c
>> and test.c and in test its enabled only with CONFIG_FEATURE_TEST_64.
>> I guess you can use that for ash.c also (efectivly make it strtol() ).
>>
>> asprintf can be done with snprintf().
> 
> I've done vasprintf with malloc+vsprintf for now, need to revisit this.
> 
> 
> The host does support LL, so i take it that i can get away with
> providing strtoll.
> 
> Question is if that should be a generic toggle (let's say
> CONFIG_HAVE_STRTOLL or the like) or not.
> The reasoning is that on embedded systems, LL operations may be
> completely unavailable or at least very costy to emulate.
> So perhaps it's of general use to be able to avoid them?
> 
> 
> PS: egrep -ri "strto[^ \t\n\(]*ll" *       
> coreutils/expr.c:#define STRTOL(s, e, b) strtoll(s, e, b)
> coreutils/test.c:       r = strtoll(s, &p, 10);
> e2fsprogs/blkid/read.c:#ifdef HAVE_STRTOULL
> e2fsprogs/blkid/read.c:#define STRTOULL strtoull /* defined in stdlib.h if you try hard enough */
> e2fsprogs/blkid/read.c:/* FIXME: need to support real strtoull here */
> e2fsprogs/blkid/read.c:#define STRTOULL strtoul
> e2fsprogs/blkid/read.c:         dev->bid_devno = STRTOULL(value, 0, 0);
> e2fsprogs/e2p/parse_num.c:      num = strtoull(arg, &p, 0);
> patches/cmp_n.diff:+    r = strtoull(arg, &e, base);
> Binary file scripts/bb_mkdep matches
> scripts/bb_mkdep.c:#define strtoll strtol
> scripts/bb_mkdep.c:                     numstackptr->val = strtoll(expr, (char **) &expr, 0);
> shell/ash.c:                    numstackptr->val = strtoll(expr, (char **) &expr, 0);
> 
> 
> 
> 



More information about the busybox mailing list