diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-03-24 18:47:23 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-03-24 19:52:16 -0700 |
commit | 42ee120e8c49c5f9aaba35689e09f9ecef407758 (patch) | |
tree | 68d73306595d0556be18cfaad64243b23f4a2b4d | |
parent | c7c7197d265a299c82c6629fba867730aad81375 (diff) | |
download | xorg-util-makedepend-42ee120e8c49c5f9aaba35689e09f9ecef407758.tar.gz |
Fix gcc, sparse & lint warnings
cppsetup.c:74:9: warning: Using plain integer as NULL pointer
parse.c: In function `gobble':
parse.c:94: warning: int format, long int arg (arg 2)
parse.c: In function `find_includes':
parse.c:641: warning: int format, long int arg (arg 2)
parse.c:664: warning: int format, long int arg (arg 2)
parse.c:677: warning: int format, long int arg (arg 2)
parse.c:684: warning: int format, long int arg (arg 2)
pr.c: In function `add_include':
pr.c:57: warning: int format, long int arg (arg 4)
pr.c:59: warning: int format, long int arg (arg 3)
declared global, could be static
sig_act main.c(142)
predefs main.c:imakemdep.h(51)
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r-- | cppsetup.c | 2 | ||||
-rw-r--r-- | def.h | 6 | ||||
-rw-r--r-- | imakemdep.h | 2 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | parse.c | 10 | ||||
-rw-r--r-- | pr.c | 4 |
6 files changed, 13 insertions, 13 deletions
@@ -71,7 +71,7 @@ lookup_variable (IfParser *ip, const char *var, int len) struct _parse_data *pd = (struct _parse_data *) ip->data; if (len > MAXNAMELEN) - return 0; + return NULL; strncpy (tmpbuf, var, len); tmpbuf[len] = '\0'; @@ -176,6 +176,6 @@ int cppsetup(const char *filename, struct inclist *inc); -extern void fatalerr(const char *, ...); -extern void warning(const char *, ...); -extern void warning1(const char *, ...); +extern void fatalerr(const char *, ...) _X_ATTRIBUTE_PRINTF(1, 2); +extern void warning(const char *, ...) _X_ATTRIBUTE_PRINTF(1, 2); +extern void warning1(const char *, ...) _X_ATTRIBUTE_PRINTF(1, 2); diff --git a/imakemdep.h b/imakemdep.h index 60222a2..97ff5b4 100644 --- a/imakemdep.h +++ b/imakemdep.h @@ -48,7 +48,7 @@ in this Software without prior written authorization from The Open Group. #undef DEF_STRINGIFY #define DEF_EVALUATE(__x) #__x #define DEF_STRINGIFY(_x) DEF_EVALUATE(_x) -const struct symtab predefs[] = { +static const struct symtab predefs[] = { #ifdef apollo {"apollo", "1"}, #endif @@ -143,7 +143,7 @@ catch (int sig) #define sa_mask sv_mask #define sa_flags sv_flags #endif -struct sigaction sig_act; +static struct sigaction sig_act; #endif /* USGISH */ #ifndef USING_AUTOCONF @@ -90,7 +90,7 @@ gobble(struct filepointer *filep, struct inclist *file, warning("%s", file_red->i_file); if (file_red != file) warning1(" (reading %s)", file->i_file); - warning1(", line %d: unknown directive == \"%s\"\n", + warning1(", line %ld: unknown directive == \"%s\"\n", filep->f_line, line); break; } @@ -637,7 +637,7 @@ find_includes(struct filepointer *filep, struct inclist *file, warning("%s", file_red->i_file); if (file_red != file) warning1(" (reading %s)", file->i_file); - warning1(", line %d: incomplete undef == \"%s\"\n", + warning1(", line %ld: incomplete undef == \"%s\"\n", filep->f_line, line); break; } @@ -660,7 +660,7 @@ find_includes(struct filepointer *filep, struct inclist *file, warning("%s", file_red->i_file); if (file_red != file) warning1(" (reading %s)", file->i_file); - warning1(", line %d: %s\n", + warning1(", line %ld: %s\n", filep->f_line, line); break; @@ -673,14 +673,14 @@ find_includes(struct filepointer *filep, struct inclist *file, warning("%s", file_red->i_file); if (file_red != file) warning1(" (reading %s)", file->i_file); - warning1(", line %d: unknown directive == \"%s\"\n", + warning1(", line %ld: unknown directive == \"%s\"\n", filep->f_line, line); break; case -2: warning("%s", file_red->i_file); if (file_red != file) warning1(" (reading %s)", file->i_file); - warning1(", line %d: incomplete include == \"%s\"\n", + warning1(", line %ld: incomplete include == \"%s\"\n", filep->f_line, line); break; } @@ -53,10 +53,10 @@ add_include(struct filepointer *filep, struct inclist *file, if (failOK) return; if (file != file_red) - warning("%s (reading %s, line %d): ", + warning("%s (reading %s, line %ld): ", file_red->i_file, file->i_file, filep->f_line); else - warning("%s, line %d: ", file->i_file, filep->f_line); + warning("%s, line %ld: ", file->i_file, filep->f_line); warning1("cannot find include file \"%s\"\n", include); show_where_not = TRUE; newfile = inc_path(file->i_file, include, type); |