Skip to contentSkip to conversation

Fix signed char problem in scripts/kconfig

PATCH In review Pierre Ossman 2 participants 2 messages Jun 22, 2005 Kconfig

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Fix signed char problem in scripts/kconfig

The signed characters in scripts are causing warnings with GCC 4 on systems with proper string functions (with char*, not signed char* as parameters). Some could be kept signed but most had to be reverted to normal chars.

Detailed changelog:

mconf.c:
- buf/bufptr was used in vsprintf() so it couldn't be signed.
confdata.c:
- conf_expand_value() used strchr() and strncat() forcing "normal" strings.
conf.c:
- line was used with several string functions so it couldn't be signed.
- strip() uses strlen() so same thing there.

scripts/kconfig/mconf.c +2 -2
Index: linux-wbsd/scripts/kconfig/mconf.c
===================================================================
@@ -254,8 +254,8 @@
 	"          USB$ => find all CONFIG_ symbols ending with USB\n"
 	"\n");
 
-static signed char buf[4096], *bufptr = buf;
-static signed char input_buf[4096];
+static char buf[4096], *bufptr = buf;
+static char input_buf[4096];
 static char filename[PATH_MAX+1] = ".config";
 static char *args[1024], **argptr = args;
 static int indent;
scripts/kconfig/confdata.c +2 -2
Index: linux-wbsd/scripts/kconfig/confdata.c
===================================================================
@@ -27,10 +27,10 @@
 	NULL,
 };
 
-static char *conf_expand_value(const signed char *in)
+static char *conf_expand_value(const char *in)
 {
 	struct symbol *sym;
-	const signed char *src;
+	const char *src;
 	static char res_value[SYMBOL_MAXLENGTH];
 	char *dst, name[SYMBOL_MAXLENGTH];
 
scripts/kconfig/conf.c +3 -3
Index: linux-wbsd/scripts/kconfig/conf.c
===================================================================
@@ -31,14 +31,14 @@
 static int indent = 1;
 static int valid_stdin = 1;
 static int conf_cnt;
-static signed char line[128];
+static char line[128];
 static struct menu *rootEntry;
 
 static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n");
 
-static void strip(signed char *str)
+static void strip(char *str)
 {
-	signed char *p = str;
+	char *p = str;
 	int l;
 
 	while ((isspace(*p)))
Acked-by on v1 2/2
#1 lore raw

Hi,

Quoted 17 lines · Pierre Ossman

The signed characters in scripts are causing warnings with GCC 4 on systems with proper string functions (with char*, not signed char* as parameters). Some could be kept signed but most had to be reverted to normal chars.

Detailed changelog:

mconf.c:
- buf/bufptr was used in vsprintf() so it couldn't be signed.
confdata.c:
- conf_expand_value() used strchr() and strncat() forcing "normal" strings.
conf.c:
- line was used with several string functions so it couldn't be signed.
- strip() uses strlen() so same thing there.

Quoted 1 line

Looks good, thanks.

bye, Roman