[PATCH] Use void* for data in llist_t instead of char*

Yann E. MORIN yann.morin.1998 at anciens.enib.fr
Fri May 19 20:48:20 UTC 2006


Robert,
All,

On Friday 19 May 2006 164, Robert P. J. Day wrote:
> 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.

Please find attached the diff to transfrom the char* data into a void* data,
and the associated corrections.

Please review and comment on the procedure:

I've built with EXTRA_CFLAGS_OPTIONS="-Wall -Werror" and got nothing (new) after
these changes.

The only applets that were enabled were the one where I found the string
"->data" and that ->data was member of a llist_t.

That means only tar and ifupdown needed patching.

I couldn't not build with make allyesconfig because:
 - I don't have SE-linux
 - gcc-4.0.3 barfs when trying to compile the shared library (or I had
   leftovers fron a previous compilation, forget it for now...)
 - the tree is now boken by ENABLE_KEEP_NSL_foobar

On the other hand, I'm a bit curious as to why gcc does not barf on such code:

----networking/ifupdown.c at 608
static const llist_t *find_list_string(const llist_t *list, const char *string)
{
    while (list) {
        if (strcmp(list->data, string) == 0) {
----snip

There are other parts of the code that IMHO should trigger a warning but
won't, even with -Wall and -Werror.

So I fixed only the erroring warnings for now.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< °_° >==-- °---.----------------:  X  AGAINST      |  /e\  There is no  |
| web: ymorin.free.fr | SETI at home 3808 | / \ HTML MAIL    |  """  conspiracy.  |
°---------------------°----------------°------------------°--------------------°
-------------- next part --------------
A non-text attachment was scrubbed...
Name: busybox-llist-data-is-voidptr.patch
Type: text/x-diff
Size: 2924 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20060519/d1faed9f/attachment.bin 


More information about the busybox mailing list