[PATCH] fix 'auto' declaration in findutils/find.c (only for warning messages)
Joe Krahn
krahn at niehs.nih.gov
Wed Mar 5 08:57:09 PST 2008
In findutils/find.c, the 'static' keyword was dropped, for GCC 4.x compatibility. The right keyword
is 'auto', which I have added here. On my 3.0 and 4.2.0 compilers, I still get a no-prototype
warning even with the 'auto' keyword, so I also inserted a prototype just before the actual
function. It looks a bit silly, but it seems to be what gcc wants. Here's a diff:
*** busybox-1.9.1.orig/findutils/find.c 2008-02-12 11:03:12.000000000 -0500
--- busybox-1.9.1/findutils/find.c 2008-03-04 12:19:13.000000000 -0500
***************
*** 513,519 ****
USE_FEATURE_FIND_NOT( bool invert_flag = 0; )
/* 'static' doesn't work here! (gcc 4.1.2) */
! action* alloc_action(int sizeof_struct, action_fp f)
{
action *ap;
appp[cur_group] = xrealloc(appp[cur_group],
(cur_action+2) * sizeof(*appp));
--- 513,521 ----
USE_FEATURE_FIND_NOT( bool invert_flag = 0; )
/* 'static' doesn't work here! (gcc 4.1.2) */
! /* GCC may give a warning without the prototype. */
! auto action* alloc_action(int sizeof_struct, action_fp f);
! auto action* alloc_action(int sizeof_struct, action_fp f)
{
action *ap;
appp[cur_group] = xrealloc(appp[cur_group],
(cur_action+2) * sizeof(*appp));
More information about the busybox
mailing list