]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Changes to resolve warnings.
authorPaul Smith <psmith@gnu.org>
Mon, 14 Nov 2011 02:26:00 +0000 (02:26 +0000)
committerPaul Smith <psmith@gnu.org>
Mon, 14 Nov 2011 02:26:00 +0000 (02:26 +0000)
Fixes Savannah bug #34608.

ChangeLog
file.c
filedef.h
function.c
make.h
misc.c
read.c

index dd8789e202313ac7816cb22607c718e2eb842c88..b7efbebc2a19eadf927c6718e81d68bde2f45fb6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-11-13  Paul Smith  <psmith@gnu.org>
 
+       * file.c (file_timestamp_cons): Match up data types to avoid warnings.
+       * filedef.h: Ditto.
+       * misc.c (concat): Ditto.
+       * read.c (eval): Assign value to avoid warnings.
+       * function.c (func_shell_base): Use fork() instead of vfork() to
+       avoid warnings.
+       * make.h (INTEGER_TYPE_SIGNED): Use <=0 to avoid warnings.
+       Fixes Savannah bug #34608.
+
        * job.c (construct_command_argv): Remove _p.
        (construct_command_argv_internal): Remove _ptr.
        Fixes Savannah bug #32567.
diff --git a/file.c b/file.c
index 93212d1cd849508ad01ac53e4f1c9e43b7e81e47..0979845bd870fcbafcb69fbacd63c317962b2128 100644 (file)
--- a/file.c
+++ b/file.c
@@ -788,9 +788,10 @@ set_command_state (struct file *file, enum cmd_state state)
 /* Convert an external file timestamp to internal form.  */
 
 FILE_TIMESTAMP
-file_timestamp_cons (const char *fname, time_t s, int ns)
+file_timestamp_cons (const char *fname, time_t stamp, long int ns)
 {
   int offset = ORDINARY_MTIME_MIN + (FILE_TIMESTAMP_HI_RES ? ns : 0);
+  FILE_TIMESTAMP s = stamp;
   FILE_TIMESTAMP product = (FILE_TIMESTAMP) s << FILE_TIMESTAMP_LO_BITS;
   FILE_TIMESTAMP ts = product + offset;
 
index 173e7538ebec0104cc3a203dba6d34f969fbc72b..07a68cc9c2a5be3ed3fa056abde10ea01ba331b1 100644 (file)
--- a/filedef.h
+++ b/filedef.h
@@ -155,7 +155,7 @@ void print_file_data_base (void);
     * 302 / 1000) \
    + 1 + 1 + 4 + 25)
 
-FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, int);
+FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, long int);
 FILE_TIMESTAMP file_timestamp_now (int *);
 void file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts);
 
index 42a0193f3f92168cc57f7a5d874dab2288d449b2..a8b9609e196b7a2a27faf9ca114911e2b95ccb0c 100644 (file)
@@ -1681,7 +1681,7 @@ func_shell_base (char *o, char **argv, int trim_newlines)
   if (pid < 0)
     perror_with_name (error_prefix, "spawn");
 # else /* ! __EMX__ */
-  pid = vfork ();
+  pid = fork ();
   if (pid < 0)
     perror_with_name (error_prefix, "fork");
   else if (pid == 0)
diff --git a/make.h b/make.h
index f5fece5ecbb1a32e671d88e2f319a4e3215baf3f..5eb4975242e14000ac0399fa3c70ff2e74fe3f56 100644 (file)
--- a/make.h
+++ b/make.h
@@ -157,8 +157,9 @@ unsigned int get_path_max (void);
 # define USHRT_MAX 65535
 #endif
 
-/* Nonzero if the integer type T is signed.  */
-#define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0)
+/* Nonzero if the integer type T is signed.
+   Use <= to avoid GCC warnings about always-false expressions.  */
+#define INTEGER_TYPE_SIGNED(t) ((t) -1 <= 0)
 
 /* The minimum and maximum values for the integer type T.
    Use ~ (t) 0, not -1, for portability to 1's complement hosts.  */
diff --git a/misc.c b/misc.c
index 607e2a7e228ff348b89d2e3fcca8f96381751785..7b5beb5eb43d242e416143086b54c917a61b825a 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -171,7 +171,7 @@ concat (num, va_alist)
 {
   static unsigned int rlen = 0;
   static char *result = NULL;
-  int ri = 0;
+  unsigned int ri = 0;
 
 #if USE_VARIADIC
   va_list args;
diff --git a/read.c b/read.c
index 58423f52434ec017dbee1c0e037fa29e044f302a..451f395ecf9ebe72e63397371ccb4ef57ddba77c 100644 (file)
--- a/read.c
+++ b/read.c
@@ -562,7 +562,7 @@ eval (struct ebuffer *ebuf, int set_default)
   char *depstr = 0;
   long nlines = 0;
   int two_colon = 0;
-  char prefix;
+  char prefix = cmd_prefix;
   const char *pattern = 0;
   const char *pattern_percent;
   struct floc *fstart;