diff options
| author | Tom Rini <trini@kernel.crashing.org> | 2004-10-27 04:27:31 +0200 |
|---|---|---|
| committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2004-10-27 04:27:31 +0200 |
| commit | 50dc57c4c7b19fe600c68881b5279b7630b75141 (patch) | |
| tree | ebf6fafc6ff3f425ffe06cd456c432ab3a4e033b /scripts/mod | |
| parent | 298039e7b2dc1bd12cb2944707ede23c8af770c4 (diff) | |
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/mod')
| -rw-r--r-- | scripts/mod/file2alias.c | 19 | ||||
| -rw-r--r-- | scripts/mod/modpost.c | 2 | ||||
| -rw-r--r-- | scripts/mod/sumversion.c | 8 |
3 files changed, 17 insertions, 12 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index f38c6d7def2a..7c8f064f03bb 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 13de17405235..74cb1c0c8e75 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 6ece36794c0d..6fe63c60c16c 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; |
