]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Fixes for enhanced GCC warnings.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 May 2016 19:52:58 +0000 (15:52 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 21 May 2016 20:22:25 +0000 (16:22 -0400)
Move function prototypes into header files and out of .c files.
Use void argument lists for functions that accept no args.
Remove unused macros.  Make private functions static.  Align
types with printf format characters.

20 files changed:
ar.c
arscan.c
commands.c
commands.h
dir.c
file.c
filedef.h
function.c
job.c
main.c
makeint.h
os.h
output.c
posixos.c
read.c
remake.c
rule.h
variable.c
variable.h
vpath.c

diff --git a/ar.c b/ar.c
index 85e91c8488e6f81a30e974cd80d408a96f771e9f..b9c1cf726c462d1882c3bc66309ac8f6f022668d 100644 (file)
--- a/ar.c
+++ b/ar.c
@@ -73,7 +73,7 @@ static long int
 ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
                   long int hdrpos UNUSED, long int datapos UNUSED,
                   long int size UNUSED, long int date,
-                  int uid UNUSED, int gid UNUSED, int mode UNUSED,
+                  int uid UNUSED, int gid UNUSED, unsigned int mode UNUSED,
                   const void *name)
 {
   return ar_name_equal (name, mem, truncated) ? date : 0;
@@ -198,7 +198,7 @@ static long int
 ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
                long int hdrpos UNUSED, long int datapos UNUSED,
                long int size UNUSED, long int date UNUSED, int uid UNUSED,
-               int gid UNUSED, int mode UNUSED, const void *arg)
+               int gid UNUSED, unsigned int mode UNUSED, const void *arg)
 {
   struct ar_glob_state *state = (struct ar_glob_state *)arg;
 
@@ -224,7 +224,7 @@ ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
 /* Return nonzero if PATTERN contains any metacharacters.
    Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
 static int
-glob_pattern_p (const char *pattern, int quote)
+ar_glob_pattern_p (const char *pattern, int quote)
 {
   const char *p;
   int opened = 0;
@@ -267,7 +267,7 @@ ar_glob (const char *arname, const char *member_pattern, unsigned int size)
 #ifdef VMS
   char *vms_member_pattern;
 #endif
-  if (! glob_pattern_p (member_pattern, 1))
+  if (! ar_glob_pattern_p (member_pattern, 1))
     return 0;
 
   /* Scan the archive for matches.
index d35686ddf8ca522e474e5bedfcb4896ddd7782f7..549fe1ec96b324f13ef1afa1d0c603fc331a2f82 100644 (file)
--- a/arscan.c
+++ b/arscan.c
@@ -547,7 +547,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
         int long_name = 0;
 #endif
         long int eltsize;
-        int eltmode;
+        unsigned int eltmode;
         long int fnval;
         off_t o;
 
@@ -872,7 +872,7 @@ static long int
 ar_member_pos (int desc UNUSED, const char *mem, int truncated,
                long int hdrpos, long int datapos UNUSED, long int size UNUSED,
                long int date UNUSED, int uid UNUSED, int gid UNUSED,
-               int mode UNUSED, const void *name)
+               unsigned int mode UNUSED, const void *name)
 {
   if (!ar_name_equal (name, mem, truncated))
     return 0;
@@ -957,7 +957,8 @@ ar_member_touch (const char *arname, const char *memname)
 long int
 describe_member (int desc, const char *name, int truncated,
                  long int hdrpos, long int datapos, long int size,
-                 long int date, int uid, int gid, int mode, const void *arg)
+                 long int date, int uid, int gid, unsigned int mode,
+                 const void *arg)
 {
   extern char *ctime ();
 
index 4303b86dc06f40a2c911f4d7ecde21fdce727d29..124b93e3bcb6d42ccea83f585ebd35d9b9b8fa40 100644 (file)
@@ -31,8 +31,6 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 # define FILE_LIST_SEPARATOR ' '
 #endif
 
-int remote_kill (int id, int sig);
-
 #ifndef HAVE_UNISTD_H
 int getpid ();
 #endif
index db95fb2fb3e630840be35381d496e5e682de957c..f7cf0640a0d135a861366ab6bd8d4d1952ed2080 100644 (file)
@@ -34,6 +34,7 @@ struct commands
 #define COMMANDS_SILENT         2 /* Silent: @.  */
 #define COMMANDS_NOERROR        4 /* No errors: -.  */
 
+RETSIGTYPE fatal_error_signal (int sig);
 void execute_file_commands (struct file *file);
 void print_commands (const struct commands *cmds);
 void delete_child_targets (struct child *child);
diff --git a/dir.c b/dir.c
index a286d2ea1953cb245836013f960d4084bfaa8cba..63c82a03f51da742642e7dbd5b411a7881a9058f 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -1169,8 +1169,6 @@ print_dir_data_base (void)
 \f
 /* Hooks for globbing.  */
 
-#include <glob.h>
-
 /* Structure describing state of iterating through a directory hash table.  */
 
 struct dirstream
@@ -1263,7 +1261,9 @@ read_dirstream (__ptr_t stream)
  */
 #if !defined(stat) && !defined(WINDOWS32) || defined(VMS)
 # ifndef VMS
+#  ifndef HAVE_SYS_STAT_H
 int stat (const char *path, struct stat *sbuf);
+#  endif
 # else
     /* We are done with the fake stat.  Go back to the real stat */
 #   ifdef stat
diff --git a/file.c b/file.c
index 2207be453c434a6c2e99208b243aadaf360118e7..ae1c285725a2b23c9132a9cc9078f8f5d95983d1 100644 (file)
--- a/file.c
+++ b/file.c
@@ -57,9 +57,6 @@ file_hash_cmp (const void *x, const void *y)
                           ((struct file const *) y)->hname);
 }
 
-#ifndef FILE_BUCKETS
-#define FILE_BUCKETS    1007
-#endif
 static struct hash_table files;
 
 /* Whether or not .SECONDARY with no prerequisites was given.  */
index b280fb8a250e8a60677c3c2b463f82fbcbefaaa6..507a0279712feb808753615e40c20858c9f0ddad 100644 (file)
--- a/filedef.h
+++ b/filedef.h
@@ -103,7 +103,7 @@ struct file
   };
 
 
-extern struct file *suffix_file, *default_file;
+extern struct file *default_file;
 
 
 struct file *lookup_file (const char *name);
@@ -117,9 +117,12 @@ void rehash_file (struct file *file, const char *name);
 void set_command_state (struct file *file, enum cmd_state state);
 void notice_finished_file (struct file *file);
 void init_hash_files (void);
+void verify_file_data_base (void);
 char *build_target_list (char *old_list);
 void print_prereqs (const struct dep *deps);
 void print_file_data_base (void);
+int try_implicit_rule (struct file *file, unsigned int depth);
+int stemlen_compare (const void *v1, const void *v2);
 
 #if FILE_TIMESTAMP_HI_RES
 # define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
index b8e69b22e1c8e7ae83f3404e7c8def218ec7b9c2..c9fcec2cce05fa49cbd8ae8b552b77cf8cf09c79 100644 (file)
@@ -627,6 +627,7 @@ func_basename_dir (char *o, char **argv, const char *funcname)
       else if (is_dir)
 #ifdef VMS
         {
+          extern int vms_report_unix_paths;
           if (vms_report_unix_paths)
             o = variable_buffer_output (o, "./", 2);
           else
@@ -1975,7 +1976,7 @@ func_shell_base (char *o, char **argv, int trim_newlines)
 }
 #endif  /* _AMIGA */
 
-char *
+static char *
 func_shell (char *o, char **argv, const char *funcname UNUSED)
 {
   return func_shell_base (o, argv, 1);
@@ -2653,10 +2654,10 @@ define_new_function (const gmk_floc *flocp, const char *name,
     OS (fatal, flocp, _("Function name too long: %s"), name);
   if (min > 255)
     ONS (fatal, flocp,
-         _("Invalid minimum argument count (%d) for function %s"), min, name);
+         _("Invalid minimum argument count (%u) for function %s"), min, name);
   if (max > 255 || (max && max < min))
     ONS (fatal, flocp,
-         _("Invalid maximum argument count (%d) for function %s"), max, name);
+         _("Invalid maximum argument count (%u) for function %s"), max, name);
 
   ent = xmalloc (sizeof (struct function_table_entry));
   ent->name = name;
diff --git a/job.c b/job.c
index 2d2c80377bb27f8d6098e31b602cbae7b0a1cf20..ddac6c41c2c42a083067de8c44f7829017255e28 100644 (file)
--- a/job.c
+++ b/job.c
@@ -24,7 +24,6 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "commands.h"
 #include "variable.h"
 #include "os.h"
-#include "debug.h"
 
 #include <string.h>
 
@@ -208,14 +207,10 @@ pid2str (pid_t pid)
   return pidstring;
 }
 
+#ifndef HAVE_GETLOADAVG
 int getloadavg (double loadavg[], int nelem);
-int start_remote_job (char **argv, char **envp, int stdin_fd, int *is_remote,
-                      int *id_ptr, int *used_stdin);
-int start_remote_job_p (int);
-int remote_status (int *exit_code_ptr, int *signal_ptr, int *coredump_ptr,
-                   int block);
+#endif
 
-RETSIGTYPE child_handler (int);
 static void free_child (struct child *);
 static void start_job_command (struct child *child);
 static int load_too_high (void);
@@ -2285,7 +2280,6 @@ exec_command (char **argv, char **envp)
     case ENOEXEC:
       {
         /* The file is not executable.  Try it as a shell script.  */
-        extern char *getenv ();
         const char *shell;
         char **new_argv;
         int argc;
diff --git a/main.c b/main.c
index c812ba4ab21f517bd7365361b2219ece25bfba91..576f2e967a32a3db00355d1e0c4c5d9066ae078d 100644 (file)
--- a/main.c
+++ b/main.c
@@ -84,18 +84,6 @@ char x;
 }
 #endif
 
-void init_dir (void);
-void remote_setup (void);
-void remote_cleanup (void);
-RETSIGTYPE fatal_error_signal (int sig);
-
-void print_variable_data_base (void);
-void print_dir_data_base (void);
-void print_rule_data_base (void);
-void print_vpath_data_base (void);
-
-void verify_file_data_base (void);
-
 #if defined HAVE_WAITPID || defined HAVE_WAIT3
 # define HAVE_WAIT_NOHANG
 #endif
@@ -645,7 +633,7 @@ initialize_global_hash_tables (void)
    Each element is true if we should stop parsing on that character.  */
 
 static void
-initialize_stopchar_map ()
+initialize_stopchar_map (void)
 {
   int i;
 
@@ -1063,7 +1051,7 @@ msdos_return_to_initial_directory (void)
 #endif  /* __MSDOS__ */
 
 static void
-reset_jobserver ()
+reset_jobserver (void)
 {
   jobserver_clear ();
   free (jobserver_auth);
@@ -1895,7 +1883,6 @@ main (int argc, char **argv, char **envp)
 
      If none of these are true, we don't need a signal handler at all.  */
   {
-    RETSIGTYPE child_handler (int sig);
 # if defined SIGCHLD
     bsd_signal (SIGCHLD, child_handler);
 # endif
@@ -3369,7 +3356,7 @@ print_version (void)
 /* Print a bunch of information about this and that.  */
 
 static void
-print_data_base ()
+print_data_base (void)
 {
   time_t when = time ((time_t *) 0);
 
index 0ee5acc396f3d9bfe55c7e170956f996d8ec8a5f..ad0a511e65bc37065958ff8436f39f1e596f49c4 100644 (file)
--- a/makeint.h
+++ b/makeint.h
@@ -450,6 +450,8 @@ extern int unixy_shell;
 extern struct rlimit stack_limit;
 #endif
 
+#include <glob.h>
+
 #define NILF ((gmk_floc *)0)
 
 #define CSTRLEN(_s)           (sizeof (_s)-1)
@@ -518,7 +520,8 @@ time_t ar_member_date (const char *);
 typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated,
                                       long int hdrpos, long int datapos,
                                       long int size, long int date, int uid,
-                                      int gid, int mode, const void *arg);
+                                      int gid, unsigned int mode,
+                                      const void *arg);
 
 long int ar_scan (const char *archive, ar_member_func_t function, const void *arg);
 int ar_name_equal (const char *name, const char *mem, int truncated);
@@ -532,6 +535,8 @@ int file_exists_p (const char *);
 int file_impossible_p (const char *);
 void file_impossible (const char *);
 const char *dir_name (const char *);
+void print_dir_data_base (void);
+void dir_setup_glob (glob_t *);
 void hash_init_directories (void);
 
 void define_default_variables (void);
@@ -554,7 +559,7 @@ void child_access (void);
 
 char *strip_whitespace (const char **begpp, const char **endpp);
 
-void show_goal_error ();
+void show_goal_error (void);
 
 /* String caching  */
 void strcache_init (void);
@@ -581,16 +586,16 @@ long int atol ();
 long int lseek ();
 # endif
 
-#endif  /* Not GNU C library or POSIX.  */
-
-#ifdef  HAVE_GETCWD
-# if !defined(VMS) && !defined(__DECC)
+# ifdef  HAVE_GETCWD
+#  if !defined(VMS) && !defined(__DECC)
 char *getcwd ();
-# endif
-#else
+#  endif
+# else
 char *getwd ();
-# define getcwd(buf, len)       getwd (buf)
-#endif
+#  define getcwd(buf, len)       getwd (buf)
+# endif
+
+#endif  /* Not GNU C library or POSIX.  */
 
 #if !HAVE_STRCASECMP
 # if HAVE_STRICMP
@@ -619,11 +624,12 @@ int strncasecmp (const char *s1, const char *s2, int n);
 #define OUTPUT_SYNC_TARGET  2
 #define OUTPUT_SYNC_RECURSE 3
 
+/* Non-GNU systems may not declare this in unistd.h.  */
+extern char **environ;
+
 extern const gmk_floc *reading_file;
 extern const gmk_floc **expanding_var;
 
-extern char **environ;
-
 extern unsigned short stopchar_map[];
 
 extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
@@ -634,6 +640,8 @@ extern int warn_undefined_variables_flag, trace_flag, posix_pedantic;
 extern int not_parallel, second_expansion, clock_skew_detected;
 extern int rebuilding_makefiles, one_shell, output_sync, verify_flag;
 
+extern const char *default_shell;
+
 /* can we run commands via 'sh -c xxx' or must we use batch files? */
 extern int batch_mode_shell;
 
@@ -685,6 +693,17 @@ vms_restore_symbol (const char *string);
 
 #endif
 
+void remote_setup (void);
+void remote_cleanup (void);
+int start_remote_job_p (int);
+int start_remote_job (char **, char **, int, int *, int *, int *);
+int remote_status (int *, int *, int *, int);
+void block_remote_children (void);
+void unblock_remote_children (void);
+int remote_kill (int id, int sig);
+void print_variable_data_base (void);
+void print_vpath_data_base (void);
+
 extern char *starting_directory;
 extern unsigned int makelevel;
 extern char *version_string, *remote_description, *make_host;
diff --git a/os.h b/os.h
index ac5350b144ed3d194ce2825504574c9849a26bb2..c1a19e1b76ee98758eb7073a6a69b46cec60667e 100644 (file)
--- a/os.h
+++ b/os.h
@@ -20,7 +20,7 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #ifdef MAKE_JOBSERVER
 
 /* Returns 1 if the jobserver is enabled, else 0.  */
-unsigned int jobserver_enabled ();
+unsigned int jobserver_enabled (void);
 
 /* Called in the master instance to set up the jobserver initially.  */
 unsigned int jobserver_setup (int job_slots);
@@ -29,28 +29,28 @@ unsigned int jobserver_setup (int job_slots);
 unsigned int jobserver_parse_auth (const char* auth);
 
 /* Returns an allocated buffer used to pass to child instances.  */
-char *jobserver_get_auth ();
+char *jobserver_get_auth (void);
 
 /* Clear this instance's jobserver configuration.  */
-void jobserver_clear ();
+void jobserver_clear (void);
 
 /* Recover all the jobserver tokens and return the number we got.  */
-unsigned int jobserver_acquire_all ();
+unsigned int jobserver_acquire_all (void);
 
 /* Release a jobserver token.  If it fails and is_fatal is 1, fatal.  */
 void jobserver_release (int is_fatal);
 
 /* Notify the jobserver that a child exited.  */
-void jobserver_signal ();
+void jobserver_signal (void);
 
 /* Get ready to start a non-recursive child.  */
-void jobserver_pre_child ();
+void jobserver_pre_child (int);
 
 /* Complete starting a non-recursive child.  */
-void jobserver_post_child ();
+void jobserver_post_child (int);
 
 /* Set up to acquire a new token.  */
-void jobserver_pre_acquire ();
+void jobserver_pre_acquire (void);
 
 /* Wait until we can acquire a jobserver token.
    TIMEOUT is 1 if we have other jobs waiting for the load to go down;
@@ -78,7 +78,7 @@ unsigned int jobserver_acquire (int timeout);
 
 /* Create a "bad" file descriptor for stdin when parallel jobs are run.  */
 #if !defined(VMD) && !defined(WINDOWS32) && !defined(_AMIGA) && !defined(__MSDOS__)
-int get_bad_stdin ();
+int get_bad_stdin (void);
 #else
 # define get_bad_stdin() (-1)
 #endif
index 475862f09009bb89977512b242ab30c9e61ace14..0a0420c610b15e7ce6dfb43d098530850a5d4a60 100644 (file)
--- a/output.c
+++ b/output.c
@@ -174,7 +174,7 @@ static sync_handle_t sync_handle = -1;
 
 /* Set up the sync handle.  Disables output_sync on error.  */
 static int
-sync_init ()
+sync_init (void)
 {
   int combined_output = 0;
 
@@ -283,7 +283,7 @@ release_semaphore (void *sem)
 /* Returns a file descriptor to a temporary file.  The file is automatically
    closed/deleted on exit.  Don't use a FILE* stream.  */
 int
-output_tmpfd ()
+output_tmpfd (void)
 {
   int fd = -1;
   FILE *tfile = tmpfile ();
@@ -558,7 +558,7 @@ output_close (struct output *out)
 
 /* We're about to generate output: be sure it's set up.  */
 void
-output_start ()
+output_start (void)
 {
 #ifndef NO_OUTPUT_SYNC
   /* If we're syncing output make sure the temporary file is set up.  */
index 4a88b3cfab26be19c553c92d6b427f148ea0a50f..4a787e4d01111265ade37a981e3d8ab907af49b3 100644 (file)
--- a/posixos.c
+++ b/posixos.c
@@ -45,7 +45,7 @@ static int job_rfd = -1;
 static char token = '+';
 
 static int
-make_job_rfd ()
+make_job_rfd (void)
 {
 #ifdef HAVE_PSELECT
   /* Pretend we succeeded.  */
@@ -117,7 +117,7 @@ jobserver_parse_auth (const char *auth)
 }
 
 char *
-jobserver_get_auth ()
+jobserver_get_auth (void)
 {
   char *auth = xmalloc ((INTSTR_LENGTH * 2) + 2);
   sprintf (auth, "%d,%d", job_fds[0], job_fds[1]);
@@ -125,13 +125,13 @@ jobserver_get_auth ()
 }
 
 unsigned int
-jobserver_enabled ()
+jobserver_enabled (void)
 {
   return job_fds[0] >= 0;
 }
 
 void
-jobserver_clear ()
+jobserver_clear (void)
 {
   if (job_fds[0] >= 0)
     close (job_fds[0]);
@@ -157,7 +157,7 @@ jobserver_release (int is_fatal)
 }
 
 unsigned int
-jobserver_acquire_all ()
+jobserver_acquire_all (void)
 {
   unsigned int tokens = 0;
 
@@ -210,7 +210,7 @@ jobserver_post_child (int recursive)
 }
 
 void
-jobserver_signal ()
+jobserver_signal (void)
 {
   if (job_rfd >= 0)
     {
@@ -220,7 +220,7 @@ jobserver_signal ()
 }
 
 void
-jobserver_pre_acquire ()
+jobserver_pre_acquire (void)
 {
   /* Make sure we have a dup'd FD.  */
   if (job_rfd < 0 && job_fds[0] >= 0 && make_job_rfd () < 0)
@@ -402,7 +402,7 @@ jobserver_acquire (int timeout)
 
 /* Create a "bad" file descriptor for stdin when parallel jobs are run.  */
 int
-get_bad_stdin ()
+get_bad_stdin (void)
 {
   static int bad_stdin = -1;
 
diff --git a/read.c b/read.c
index a71eaebe1bd4db65ee3d1cbd8b6720b815184197..c6eb5c885a3512c886e682427b713b301e8376a7 100644 (file)
--- a/read.c
+++ b/read.c
@@ -18,8 +18,6 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <assert.h>
 
-#include <glob.h>
-
 #include "filedef.h"
 #include "dep.h"
 #include "job.h"
@@ -2920,7 +2918,6 @@ tilde_expand (const char *name)
 #ifndef VMS
   if (name[1] == '/' || name[1] == '\0')
     {
-      extern char *getenv ();
       char *home_dir;
       int is_variable;
 
@@ -2943,7 +2940,6 @@ tilde_expand (const char *name)
 # if !defined(_AMIGA) && !defined(WINDOWS32)
       if (home_dir == 0 || home_dir[0] == '\0')
         {
-          extern char *getlogin ();
           char *logname = getlogin ();
           home_dir = 0;
           if (logname != 0)
@@ -3008,8 +3004,6 @@ tilde_expand (const char *name)
         PARSEFS_NOCACHE - Do not add filenames to the strcache (caller frees)
   */
 
-void dir_setup_glob (glob_t *glob);
-
 void *
 parse_file_seq (char **stringp, unsigned int size, int stopmap,
                 const char *prefix, int flags)
index c837903e206e21150307d3853e58e237be7c3213..63ee64856ce4fb2e5b3ed565d07f8dfabb1b398c 100644 (file)
--- a/remake.c
+++ b/remake.c
@@ -37,8 +37,6 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <io.h>
 #endif
 
-extern int try_implicit_rule (struct file *file, unsigned int depth);
-
 
 /* The test for circular dependencies is based on the 'updating' bit in
    'struct file'.  However, double colon targets have separate 'struct
@@ -269,7 +267,7 @@ update_goal_chain (struct goaldep *goaldeps)
    about errors, show an error message the first time.  */
 
 void
-show_goal_error ()
+show_goal_error (void)
 {
   struct goaldep *goal;
 
diff --git a/rule.h b/rule.h
index 72ff2e99abb982001e80b69616d104c8d20b0c0c..9156b8e6d041369560c06dd8a7148506f26e7482 100644 (file)
--- a/rule.h
+++ b/rule.h
@@ -55,3 +55,4 @@ void install_pattern_rule (struct pspec *p, int terminal);
 void create_pattern_rule (const char **targets, const char **target_percents,
                           unsigned int num, int terminal, struct dep *deps,
                           struct commands *commands, int override);
+void print_rule_data_base (void);
index 9c932d4d50c0899ee2062e8f3cefe1b967996e5c..26baabd454a481e4825686241ebe960153621ab4 100644 (file)
@@ -822,7 +822,6 @@ merge_variable_set_lists (struct variable_set_list **setlist0,
 void
 define_automatic_variables (void)
 {
-  extern const char* default_shell;
   struct variable *v;
   char buf[200];
 
@@ -1049,7 +1048,6 @@ target_environment (struct file *file)
                   /* If this is the SHELL variable and it's not exported,
                      then add the value from our original environment, if
                      the original environment defined a value for SHELL.  */
-                  extern struct variable shell_var;
                   if (streq (v->name, "SHELL") && shell_var.value)
                     {
                       v = &shell_var;
@@ -1136,7 +1134,7 @@ set_special_var (struct variable *var)
  * result. This removes only ONE newline (if any) at the end, for maximum
  * compatibility with the *BSD makes.  If it fails, returns NULL. */
 
-char *
+static char *
 shell_result (const char *p)
 {
   char *buf;
@@ -1739,7 +1737,7 @@ print_variable_data_base (void)
 
   {
     struct pattern_var *p;
-    int rules = 0;
+    unsigned int rules = 0;
 
     for (p = pattern_vars; p != 0; p = p->next)
       {
index 75d4c0b6154878bd5555909451741410d81ff456..583a65f498523a6dc608c09cef2016a5755150f2 100644 (file)
@@ -110,6 +110,7 @@ struct pattern_var
 extern char *variable_buffer;
 extern struct variable_set_list *current_variable_set_list;
 extern struct variable *default_goal_var;
+extern struct variable shell_var;
 
 /* expand.c */
 char *variable_buffer_output (char *ptr, const char *string, unsigned int length);
@@ -148,7 +149,6 @@ void pop_variable_scope (void);
 void define_automatic_variables (void);
 void initialize_file_variables (struct file *file, int reading);
 void print_file_variables (const struct file *file);
-void print_file_variables (const struct file *file);
 void print_target_variables (const struct file *file);
 void merge_variable_set_lists (struct variable_set_list **to_list,
                                struct variable_set_list *from_list);
diff --git a/vpath.c b/vpath.c
index 2f1dafd5a1128e27736b9f53607d332b325448a4..0c7dce3576825cee46ff17e7b5043eae2d7c166c 100644 (file)
--- a/vpath.c
+++ b/vpath.c
@@ -52,7 +52,7 @@ static struct vpath *gpaths;
    variable.  */
 
 void
-build_vpath_lists ()
+build_vpath_lists (void)
 {
   register struct vpath *new = 0;
   register struct vpath *old, *nexto;