llist_t and llist_pop
Robert P. J. Day
rpjday at mindspring.com
Fri May 19 18:05:19 UTC 2006
On Fri, 19 May 2006, Yann E. MORIN wrote:
> On Friday 19 May 2006 164, Robert P. J. Day wrote:
> > ah, i just noticed what's happening with that "void*" versus "char*"
> > in the llist routines. normally, you'd expect that a list would
> > accept completely generic "void*" pointers to store.
> > but if you look at archival/tar.c, line 305:
> >
> > if (excluded_files->data[0] == '/') {
> >
> > what that's clearly doing is treating the data pointer as a "char*" so
> > that it can immediately do a character comparison. the *proper* way,
> > i would think, is to have to cast that "void*" to "char*" first. in
> > short, the code is being lazy so it doesn't have to do that cast every
> > time it needs to do a character comparison.
> >
> > at least, that's the way i read it. the proper fix would be for llist
> > to use *only* "void*" pointers, and have all of the calling routines
> > be forced to do the proper casting.
>
> Doing this at this very moment... Lots of files impacted.
>
> Is it acceptable to not cast when calling llist_add_to{,_end}?
yes, that's generally acceptable -- no need to cast to void*.
rday
More information about the busybox
mailing list