error: format not a string literal and no format arguments

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Fri Oct 23 15:28:56 UTC 2009


Linux 2.6.30-gentoo-r5 #1 SMP Mon Sep 21 11:16:30 CEST 2009 x86_64
Intel(R) Core(TM) i7 CPU @ 9200 @ 2.67GHz GenuineIntel GNU/Linux

gcc (Gentoo 4.3.4 p1.0, pie-10.1.5) 4.3.4


Many files show errors similar to this:

coreutils/df.c: In function 'df_main':
coreutils/df.c:111: error: format not a string literal and no format arguments

Solved by:

--- coreutils/df.c.orig	2009-10-22 00:55:55.000000000 +0200
+++ coreutils/df.c	2009-10-23 14:20:37.608995275 +0200
@@ -108,7 +108,7 @@ int df_main(int argc, char **argv)
 	if (optind >= argc) {
 		mount_table = setmntent(bb_path_mtab_file, "r");
 		if (!mount_table)
-			bb_perror_msg_and_die(bb_path_mtab_file);
+			bb_perror_msg_and_die("%s", bb_path_mtab_file);
 	}

 	while (1) {


And this:

networking/ifplugd.c: In function 'detect_link_ethtool':
networking/ifplugd.c:364: error: assignment from incompatible pointer type

is as far as I got today.


Cheers,

-- 
Cristian


More information about the busybox mailing list