aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTom Rini <trini@kernel.crashing.org>2004-10-27 04:27:31 +0200
committerSam Ravnborg <sam@mars.ravnborg.org>2004-10-27 04:27:31 +0200
commit50dc57c4c7b19fe600c68881b5279b7630b75141 (patch)
treeebf6fafc6ff3f425ffe06cd456c432ab3a4e033b /scripts
parent298039e7b2dc1bd12cb2944707ede23c8af770c4 (diff)
downloadhistory-50dc57c4c7b19fe600c68881b5279b7630b75141.tar.gz
kbuild: warning fixes on Solaris 9
The following set of patches is based loosely on the patches that Jean-Christophe Dubois came up with for 2.6.7. Where as the original patches added a number of casts to unsigned char, I went the route of making the chars be explicitly signed. I honestly don't know which route is better to go down. Doing this is the bulk of the patch. Out of the rest of the odds 'n ends is that on Solaris, Elf32_Word is a ulong, which means all of the printf's are unhappy (uint format, ulong arg) for most of the typedefs. Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/basic/docproc.c14
-rw-r--r--scripts/basic/fixdep.c10
-rw-r--r--scripts/basic/split-include.c2
-rw-r--r--scripts/conmakehash.c2
-rw-r--r--scripts/kconfig/conf.c6
-rw-r--r--scripts/kconfig/confdata.c6
-rw-r--r--scripts/kconfig/mconf.c4
-rw-r--r--scripts/kconfig/symbol.c2
-rw-r--r--scripts/mod/file2alias.c19
-rw-r--r--scripts/mod/modpost.c2
-rw-r--r--scripts/mod/sumversion.c8
11 files changed, 40 insertions, 35 deletions
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c
index cb02baa63256ba..8ca7ecdb68fbb6 100644
--- a/scripts/basic/docproc.c
+++ b/scripts/basic/docproc.c
@@ -52,7 +52,7 @@ FILEONLY *internalfunctions;
FILEONLY *externalfunctions;
FILEONLY *symbolsonly;
-typedef void FILELINE(char * file, char * line);
+typedef void FILELINE(char * file, signed char * line);
FILELINE * singlefunctions;
FILELINE * entity_system;
@@ -148,9 +148,9 @@ struct symfile * filename_exist(char * filename)
* Files are separated by tabs.
*/
void adddep(char * file) { printf("\t%s", file); }
-void adddep2(char * file, char * line) { line = line; adddep(file); }
+void adddep2(char * file, signed char * line) { line = line; adddep(file); }
void noaction(char * line) { line = line; }
-void noaction2(char * file, char * line) { file = file; line = line; }
+void noaction2(char * file, signed char * line) { file = file; line = line; }
/* Echo the line without further action */
void printline(char * line) { printf("%s", line); }
@@ -179,8 +179,8 @@ void find_export_symbols(char * filename)
perror(real_filename);
}
while(fgets(line, MAXLINESZ, fp)) {
- char *p;
- char *e;
+ signed char *p;
+ signed char *e;
if (((p = strstr(line, "EXPORT_SYMBOL_GPL")) != 0) ||
((p = strstr(line, "EXPORT_SYMBOL")) != 0)) {
/* Skip EXPORT_SYMBOL{_GPL} */
@@ -253,7 +253,7 @@ void extfunc(char * filename) { docfunctions(filename, FUNCTION); }
* Call kernel-doc with the following parameters:
* kernel-doc -docbook -function function1 [-function function2]
*/
-void singfunc(char * filename, char * line)
+void singfunc(char * filename, signed char * line)
{
char *vec[200]; /* Enough for specific functions */
int i, idx = 0;
@@ -290,7 +290,7 @@ void singfunc(char * filename, char * line)
void parse_file(FILE *infile)
{
char line[MAXLINESZ];
- char * s;
+ signed char * s;
while(fgets(line, MAXLINESZ, infile)) {
if (line[0] == '!') {
s = line + 2;
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 8c4c703958cd89..56e4a3d9a8a7c9 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -217,12 +217,12 @@ void use_config(char *m, int slen)
printf(" $(wildcard include/config/%s.h) \\\n", s);
}
-void parse_config_file(char *map, size_t len)
+void parse_config_file(signed char *map, size_t len)
{
int *end = (int *) (map + len);
/* start at +1, so that p can never be < map */
int *m = (int *) map + 1;
- char *p, *q;
+ signed char *p, *q;
for (; m < end; m++) {
if (*m == INT_CONF) { p = (char *) m ; goto conf; }
@@ -291,9 +291,9 @@ void do_config_file(char *filename)
void parse_dep_file(void *map, size_t len)
{
- char *m = map;
- char *end = m + len;
- char *p;
+ signed char *m = map;
+ signed char *end = m + len;
+ signed char *p;
char s[PATH_MAX];
p = strchr(m, ':');
diff --git a/scripts/basic/split-include.c b/scripts/basic/split-include.c
index 459c45276cb1a4..60fc4d8ebaa9ca 100644
--- a/scripts/basic/split-include.c
+++ b/scripts/basic/split-include.c
@@ -104,7 +104,7 @@ int main(int argc, const char * argv [])
/* Read config lines. */
while (fgets(line, buffer_size, fp_config))
{
- const char * str_config;
+ const signed char * str_config;
int is_same;
int itarget;
diff --git a/scripts/conmakehash.c b/scripts/conmakehash.c
index e0c6891a9ad4f5..93dd23f21ec96b 100644
--- a/scripts/conmakehash.c
+++ b/scripts/conmakehash.c
@@ -33,7 +33,7 @@ void usage(char *argv0)
int getunicode(char **p0)
{
- char *p = *p0;
+ unsigned char *p = *p0;
while (*p == ' ' || *p == '\t')
p++;
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index cdc72014d43382..a494d1aeb9f9c6 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -31,14 +31,14 @@ char *defconfig_file;
static int indent = 1;
static int valid_stdin = 1;
static int conf_cnt;
-static char line[128];
+static signed char line[128];
static struct menu *rootEntry;
static char nohelp_text[] = "Sorry, no help available for this option yet.\n";
-static void strip(char *str)
+static void strip(signed char *str)
{
- char *p = str;
+ signed char *p = str;
int l;
while ((isspace(*p)))
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index b5f2fc031503c3..1e82ae390a69d7 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -27,10 +27,10 @@ const char *conf_confnames[] = {
NULL,
};
-static char *conf_expand_value(const char *in)
+static char *conf_expand_value(const signed char *in)
{
struct symbol *sym;
- const char *src;
+ const signed char *src;
static char res_value[SYMBOL_MAXLENGTH];
char *dst, name[SYMBOL_MAXLENGTH];
@@ -295,7 +295,7 @@ int conf_write(const char *name)
} else
basename = conf_def_filename;
- sprintf(newname, "%s.tmpconfig.%d", dirname, getpid());
+ sprintf(newname, "%s.tmpconfig.%d", dirname, (int)getpid());
out = fopen(newname, "w");
if (!out)
return 1;
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 91789cc9d2af30..995f800b1bd0d3 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -82,8 +82,8 @@ save_config_help[] =
"leave this blank.\n"
;
-static char buf[4096], *bufptr = buf;
-static char input_buf[4096];
+static signed char buf[4096], *bufptr = buf;
+static signed char input_buf[4096];
static char filename[PATH_MAX+1] = ".config";
static char *args[1024], **argptr = args;
static int indent;
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index 16b48cf883da19..dc35e0787a4f67 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -421,7 +421,7 @@ tristate sym_toggle_tristate_value(struct symbol *sym)
bool sym_string_valid(struct symbol *sym, const char *str)
{
- char ch;
+ signed char ch;
switch (sym->type) {
case S_STRING:
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index f38c6d7def2a33..7c8f064f03bbe7 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -12,17 +12,22 @@
#include "modpost.h"
-/* We use the ELF typedefs, since we can't rely on stdint.h being present. */
-
+/* We use the ELF typedefs for kernel_ulong_t but bite the bullet and
+ * use either stdint.h or inttypes.h for the rest. */
#if KERNEL_ELFCLASS == ELFCLASS32
-typedef Elf32_Addr kernel_ulong_t;
+typedef Elf32_Addr kernel_ulong_t;
+#else
+typedef Elf64_Addr kernel_ulong_t;
+#endif
+#ifdef __sun__
+#include <inttypes.h>
#else
-typedef Elf64_Addr kernel_ulong_t;
+#include <stdint.h>
#endif
-typedef Elf32_Word __u32;
-typedef Elf32_Half __u16;
-typedef unsigned char __u8;
+typedef uint32_t __u32;
+typedef uint16_t __u16;
+typedef unsigned char __u8;
/* Big exception to the "don't include kernel headers into userspace, which
* even potentially has different endianness and word sizes, since
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 13de1740523501..74cb1c0c8e75b4 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -219,7 +219,7 @@ get_next_line(unsigned long *pos, void *file, unsigned long size)
static char line[4096];
int skip = 1;
size_t len = 0;
- char *p = (char *)file + *pos;
+ signed char *p = (char *)file + *pos;
char *s = line;
for (; *pos < size ; (*pos)++)
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c
index 6ece36794c0d0b..6fe63c60c16cd5 100644
--- a/scripts/mod/sumversion.c
+++ b/scripts/mod/sumversion.c
@@ -252,9 +252,9 @@ static int parse_comment(const char *file, unsigned long len)
}
/* FIXME: Handle .s files differently (eg. # starts comments) --RR */
-static int parse_file(const char *fname, struct md4_ctx *md)
+static int parse_file(const signed char *fname, struct md4_ctx *md)
{
- char *file;
+ signed char *file;
unsigned long i, len;
file = grab_file(fname, &len);
@@ -332,7 +332,7 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md)
Sum all files in the same dir or subdirs.
*/
while ((line = get_next_line(&pos, file, flen)) != NULL) {
- char* p = line;
+ signed char* p = line;
if (strncmp(line, "deps_", sizeof("deps_")-1) == 0) {
check_files = 1;
continue;
@@ -456,7 +456,7 @@ out:
close(fd);
}
-static int strip_rcs_crap(char *version)
+static int strip_rcs_crap(signed char *version)
{
unsigned int len, full_len;