On Friday 30 May 2008 09:43, Cristian Ionescu-Idbohrn wrote:
> When .config contains this combination:
> 
>   CONFIG_FEATURE_TAR_GZIP=y
>   # CONFIG_FEATURE_TAR_BZIP2 is not set
> 
> this warning shows up:
> 
>   archival/tar.c: In function 'vfork_compressor':
>   archival/tar.c:508: warning: unused parameter 'gzip'
> 
> The attached patch attempts to correct that.

This may lead to parameter being actually passed (useless code
will be generated). Sometimes gcc optimizes it out, but don't
count on that.

This way, you do not generate this extra code:
--
vda

diff -d -urpN busybox.4/archival/tar.c busybox.5/archival/tar.c
--- busybox.4/archival/tar.c    2008-06-07 06:25:53.000000000 +0200
+++ busybox.5/archival/tar.c    2008-06-14 21:35:56.000000000 +0200
@@ -504,6 +504,9 @@ static int writeFileToTarball(const char
 }

 #if ENABLE_FEATURE_TAR_GZIP || ENABLE_FEATURE_TAR_BZIP2
+#if !(ENABLE_FEATURE_TAR_GZIP && ENABLE_FEATURE_TAR_BZIP2)
+#define vfork_compressor(tar_fd, gzip) vfork_compressor(tar_fd)
+#endif
 /* Don't inline: vfork scares gcc and pessimizes code */
 static void NOINLINE vfork_compressor(int tar_fd, int gzip)
 {
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to