Attached is a patch that fixes the following minor glitches that I found when building GNU Make 4.1.90 with GCC warnings enabled:

Use 'unsigned int', not 'int' for modes printed via %o, as GCC warns
when printing a signed value with %o (is this undefined behavior?).

Rename ar.c's glob_pattern_p to ar_glob_pattern_p to avoid confusion
with glob.h's definition of the same symbol, needed now that makeint.h
includes glob.h (see below).

Remove unused macros PORTAR, FILE_BUCKETS, REALLOC, CLONE.

Move declarations of extern functions into .h files, so that they are
automatically checked for consistency against their definitions.
Since one of these functions uses glob_t, this entails having
makeint.h include glob.h.

Do not redeclare system functions like 'stat'.

Remove multiple declarations of suffix_file.

The functions 'func_shell' and 'shell_result' are now static.

Use %u, not %d, to print unsigned integers.

In getloadavg.c, use the same rule for defining 'setlocale' that
is already used elsewhere.

In getopt1.c, include getopt.h after including stdio.h, so that
getopt.h's use of __GNU_LIBRARY__ has the intended effect.

Remove unused macro _NO_PROTO in getopt.c.  This is no longer needed
anyway, as OSF/1 (obsolete since 1995) and AIX 3.2 (1992) are long dead.

Remove declarations of getenv.  We can safely assume C89 now.

In job.c, remove duplicate inclusion of debug.h.

Declare getloadavg and getcwd only on systems that lack them.

Use function prototypes even for functions that have no arguments, as
the prototype-free versions aren't checked as well.

Remove duplicate declaration of print_file_variables.


Here is the command line that I used to discover the above issues, on Fedora 23:

make CFLAGS='-g -O2 -Werror -W -Wabi -Waddress -Waggressive-loop-optimizations -Wall -Wattributes -Wbool-compare -Wbuiltin-macro-redefined -Wcast-align -Wchar-subscripts -Wchkp -Wclobbered -Wcomment -Wcomments -Wcoverage-mismatch -Wcpp -Wdate-time -Wdeprecated -Wdeprecated-declarations -Wdesignated-init -Wdisabled-optimization -Wdiscarded-array-qualifiers -Wdiscarded-qualifiers -Wdiv-by-zero -Wdouble-promotion -Wempty-body -Wendif-labels -Wenum-compare -Wextra -Wformat-contains-nul -Wformat-extra-args -Wformat-security -Wformat-signedness -Wformat-y2k -Wformat-zero-length -Wfree-nonheap-object -Wignored-qualifiers -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wincompatible-pointer-types -Winit-self -Wint-conversion -Wint-to-pointer-cast -Winvalid-memory-model -Winvalid-pch -Wjump-misses-init -Wlogical-not-parentheses -Wlogical-op -Wmain -Wmaybe-uninitialized -Wmemset-transposed-args -Wmissing-braces -Wmissing-declarations -Wmissing-include-dirs -Wmissing-parameter-type -Wmissing-prototypes -Wmultichar -Wnarrowing -Wnested-externs -Wnonnull -Wodr -Wold-style-declaration -Wold-style-definition -Wopenmp-simd -Woverflow -Woverride-init -Wpacked -Wpacked-bitfield-compat -Wparentheses -Wpointer-arith -Wpointer-sign -Wpointer-to-int-cast -Wpragmas -Wreturn-local-addr -Wreturn-type -Wsequence-point -Wshift-count-negative -Wshift-count-overflow -Wsizeof-array-argument -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-prototypes -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wswitch-bool -Wtrampolines -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-function -Wunused-label -Wunused-local-typedefs -Wunused-macros -Wunused-result -Wunused-value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvector-operation-performance -Wvolatile-register-var -Wwrite-strings -Warray-bounds=2 -Wnormalized=nfc -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-format-nonliteral -Wredundant-decls'

diff -pu make-4.1.90/ar.c make-fix/ar.c
--- make-4.1.90/ar.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/ar.c	2016-04-27 07:56:07.605951804 -0700
@@ -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 ch
 /* 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
 #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.
diff -pu make-4.1.90/arscan.c make-fix/arscan.c
--- make-4.1.90/arscan.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/arscan.c	2016-04-27 08:23:22.808442782 -0700
@@ -296,23 +296,6 @@ ar_scan (const char *archive, ar_member_
 #undef  M_XENIX
 #endif
 
-/* On the sun386i and in System V rel 3, ar.h defines two different archive
-   formats depending upon whether you have defined PORTAR (normal) or PORT5AR
-   (System V Release 1).  There is no default, one or the other must be defined
-   to have a nonzero value.  */
-
-#if (!defined (PORTAR) || PORTAR == 0) && (!defined (PORT5AR) || PORT5AR == 0)
-#undef  PORTAR
-#ifdef M_XENIX
-/* According to Jim Sievert <j...@rsvl.unisys.com>, for SCO XENIX defining
-   PORTAR to 1 gets the wrong archive format, and defining it to 0 gets the
-   right one.  */
-#define PORTAR 0
-#else
-#define PORTAR 1
-#endif
-#endif
-
 /* On AIX, define these symbols to be sure to get both archive formats.
    AIX 4.3 introduced the "big" archive format to support 64-bit object
    files, so on AIX 4.3 systems we need to support both the "normal" and
@@ -547,7 +530,7 @@ ar_scan (const char *archive, ar_member_
         int long_name = 0;
 #endif
         long int eltsize;
-        int eltmode;
+        unsigned int eltmode;
         long int fnval;
         off_t o;
 
@@ -872,7 +855,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 +940,8 @@ ar_member_touch (const char *arname, con
 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 ();
 
diff -pu make-4.1.90/commands.c make-fix/commands.c
--- make-4.1.90/commands.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/commands.c	2016-04-27 07:56:25.797046830 -0700
@@ -31,8 +31,6 @@ this program.  If not, see <http://www.g
 # define FILE_LIST_SEPARATOR ' '
 #endif
 
-int remote_kill (int id, int sig);
-
 #ifndef HAVE_UNISTD_H
 int getpid ();
 #endif
diff -pu make-4.1.90/commands.h make-fix/commands.h
--- make-4.1.90/commands.h	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/commands.h	2016-04-26 16:57:03.024912976 -0700
@@ -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);
Common subdirectories: make-4.1.90/config and make-fix/config
diff -pu make-4.1.90/dir.c make-fix/dir.c
--- make-4.1.90/dir.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/dir.c	2016-04-27 07:58:31.316700364 -0700
@@ -1167,8 +1167,6 @@ print_dir_data_base (void)
 
 /* Hooks for globbing.  */
 
-#include <glob.h>
-
 /* Structure describing state of iterating through a directory hash table.  */
 
 struct dirstream
@@ -1261,7 +1259,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
Common subdirectories: make-4.1.90/doc and make-fix/doc
diff -pu make-4.1.90/file.c make-fix/file.c
--- make-4.1.90/file.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/file.c	2016-04-26 17:00:26.968239729 -0700
@@ -57,9 +57,6 @@ file_hash_cmp (const void *x, const void
                           ((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.  */
diff -pu make-4.1.90/filedef.h make-fix/filedef.h
--- make-4.1.90/filedef.h	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/filedef.h	2016-04-27 07:55:46.219840090 -0700
@@ -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, con
 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) \
diff -pu make-4.1.90/function.c make-fix/function.c
--- make-4.1.90/function.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/function.c	2016-04-26 17:01:44.090649591 -0700
@@ -1975,7 +1975,7 @@ func_shell_base (char *o, char **argv, i
 }
 #endif  /* _AMIGA */
 
-char *
+static char *
 func_shell (char *o, char **argv, const char *funcname UNUSED)
 {
   return func_shell_base (o, argv, 1);
@@ -2653,10 +2653,10 @@ define_new_function (const gmk_floc *flo
     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 -pu make-4.1.90/getloadavg.c make-fix/getloadavg.c
--- make-4.1.90/getloadavg.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/getloadavg.c	2016-04-27 07:46:53.711063124 -0700
@@ -97,8 +97,7 @@ extern int errno;
 
 #if HAVE_LOCALE_H
 # include <locale.h>
-#endif
-#if !HAVE_SETLOCALE
+#else
 # define setlocale(Category, Locale) /* empty */
 #endif
 
diff -pu make-4.1.90/getopt1.c make-fix/getopt1.c
--- make-4.1.90/getopt1.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/getopt1.c	2016-04-26 17:04:03.455390370 -0700
@@ -20,8 +20,6 @@ this program.  If not, see <http://www.g
 #include <config.h>
 #endif
 
-#include "getopt.h"
-
 #if !defined __STDC__ || !__STDC__
 /* This is a separate conditional since some stdc systems
    reject `defined (const)'.  */
@@ -32,6 +30,8 @@ this program.  If not, see <http://www.g
 
 #include <stdio.h>
 
+#include "getopt.h"
+
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself.  This code is part of the GNU C
    Library, but also included in many other GNU distributions.  Compiling
diff -pu make-4.1.90/getopt.c make-fix/getopt.c
--- make-4.1.90/getopt.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/getopt.c	2016-04-27 07:29:53.669802400 -0700
@@ -20,12 +20,6 @@ A PARTICULAR PURPOSE.  See the GNU Gener
 You should have received a copy of the GNU General Public License along with
 this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
-   Ditto for AIX 3.2 and <stdlib.h>.  */
-#ifndef _NO_PROTO
-# define _NO_PROTO
-#endif
-
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif
@@ -201,10 +195,6 @@ static char *posixly_correct;
 /* Avoid depending on library functions or files
    whose names are inconsistent.  */
 
-#ifndef getenv
-extern char *getenv ();
-#endif
-
 static char *
 my_index (const char *str, int chr)
 {
Common subdirectories: make-4.1.90/glob and make-fix/glob
diff -pu make-4.1.90/hash.c make-fix/hash.c
--- make-4.1.90/hash.c	2014-10-05 09:24:51.000000000 -0700
+++ make-fix/hash.c	2016-04-27 07:44:45.456398446 -0700
@@ -19,8 +19,6 @@ this program.  If not, see <http://www.g
 
 #define	CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
 #define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
-#define REALLOC(o, t, n) ((t *) xrealloc ((o), sizeof (t) * (n)))
-#define CLONE(o, t, n) ((t *) memcpy (MALLOC (t, (n)), (o), sizeof (t) * (n)))
 
 static void hash_rehash __P((struct hash_table* ht));
 static unsigned long round_up_2 __P((unsigned long rough));
@@ -277,10 +275,10 @@ void
 hash_print_stats (struct hash_table *ht, FILE *out_FILE)
 {
   /* GKM FIXME: honor NO_FLOAT */
-  fprintf (out_FILE, _("Load=%ld/%ld=%.0f%%, "), ht->ht_fill, ht->ht_size,
+  fprintf (out_FILE, _("Load=%lu/%lu=%.0f%%, "), ht->ht_fill, ht->ht_size,
 	   100.0 * (double) ht->ht_fill / (double) ht->ht_size);
-  fprintf (out_FILE, _("Rehash=%d, "), ht->ht_rehashes);
-  fprintf (out_FILE, _("Collisions=%ld/%ld=%.0f%%"), ht->ht_collisions, ht->ht_lookups,
+  fprintf (out_FILE, _("Rehash=%u, "), ht->ht_rehashes);
+  fprintf (out_FILE, _("Collisions=%lu/%lu=%.0f%%"), ht->ht_collisions, ht->ht_lookups,
 	   (ht->ht_lookups
 	    ? (100.0 * (double) ht->ht_collisions / (double) ht->ht_lookups)
 	    : 0));
diff -pu make-4.1.90/job.c make-fix/job.c
--- make-4.1.90/job.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/job.c	2016-04-27 08:01:08.484516296 -0700
@@ -24,7 +24,6 @@ this program.  If not, see <http://www.g
 #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;
 }
 
+#if !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 -pu make-4.1.90/main.c make-fix/main.c
--- make-4.1.90/main.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/main.c	2016-04-27 07:43:26.295988199 -0700
@@ -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;
 
@@ -1062,7 +1050,7 @@ msdos_return_to_initial_directory (void)
 #endif  /* __MSDOS__ */
 
 static void
-reset_jobserver ()
+reset_jobserver (void)
 {
   jobserver_clear ();
   free (jobserver_auth);
@@ -1894,7 +1882,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
@@ -3368,7 +3355,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);
 
diff -pu make-4.1.90/makeint.h make-fix/makeint.h
--- make-4.1.90/makeint.h	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/makeint.h	2016-04-27 07:57:02.893240609 -0700
@@ -521,7 +521,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);
@@ -530,11 +531,15 @@ int ar_member_touch (const char *arname,
 #endif
 #endif
 
+#include <glob.h>
+
 int dir_file_exists_p (const char *, const char *);
 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);
@@ -557,7 +562,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);
@@ -584,16 +589,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
@@ -625,7 +630,9 @@ int strncasecmp (const char *s1, const c
 extern const gmk_floc *reading_file;
 extern const gmk_floc **expanding_var;
 
+#ifndef HAVE_UNISTD_H
 extern char **environ;
+#endif
 
 extern unsigned short stopchar_map[];
 
@@ -637,6 +644,8 @@ extern int warn_undefined_variables_flag
 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;
 
@@ -688,6 +697,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 -pu make-4.1.90/os.h make-fix/os.h
--- make-4.1.90/os.h	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/os.h	2016-04-27 07:28:39.287419260 -0700
@@ -20,7 +20,7 @@ this program.  If not, see <http://www.g
 #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_sl
 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 time
 
 /* 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
diff -pu make-4.1.90/output.c make-fix/output.c
--- make-4.1.90/output.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/output.c	2016-04-27 07:31:57.890442256 -0700
@@ -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.  */
Common subdirectories: make-4.1.90/po and make-fix/po
diff -pu make-4.1.90/posixos.c make-fix/posixos.c
--- make-4.1.90/posixos.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/posixos.c	2016-04-27 07:31:39.630348199 -0700
@@ -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;
 
@@ -207,7 +207,7 @@ jobserver_post_child (int recursive)
 }
 
 void
-jobserver_signal ()
+jobserver_signal (void)
 {
   if (job_rfd >= 0)
     {
@@ -217,7 +217,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)
@@ -399,7 +399,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 -pu make-4.1.90/read.c make-fix/read.c
--- make-4.1.90/read.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/read.c	2016-04-27 07:32:16.867540006 -0700
@@ -18,8 +18,6 @@ this program.  If not, see <http://www.g
 
 #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)
diff -pu make-4.1.90/remake.c make-fix/remake.c
--- make-4.1.90/remake.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/remake.c	2016-04-27 07:32:32.960622900 -0700
@@ -37,8 +37,6 @@ this program.  If not, see <http://www.g
 #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 *goald
    about errors, show an error message the first time.  */
 
 void
-show_goal_error ()
+show_goal_error (void)
 {
   if ((goal_dep->flags & (RM_INCLUDED|RM_DONTCARE)) != RM_INCLUDED)
     return;
diff -pu make-4.1.90/rule.h make-fix/rule.h
--- make-4.1.90/rule.h	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/rule.h	2016-04-27 07:33:47.456006623 -0700
@@ -55,3 +55,4 @@ void install_pattern_rule (struct pspec
 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);
Common subdirectories: make-4.1.90/tests and make-fix/tests
diff -pu make-4.1.90/variable.c make-fix/variable.c
--- make-4.1.90/variable.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/variable.c	2016-04-27 07:41:50.827493435 -0700
@@ -822,7 +822,6 @@ merge_variable_set_lists (struct variabl
 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;
@@ -1750,7 +1748,7 @@ print_variable_data_base (void)
     if (rules == 0)
       puts (_("\n# No pattern-specific variable values."));
     else
-      printf (_("\n# %u pattern-specific variable values"), rules);
+      printf (_("\n# %d pattern-specific variable values"), rules);
   }
 }
 
diff -pu make-4.1.90/variable.h make-fix/variable.h
--- make-4.1.90/variable.h	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/variable.h	2016-04-27 07:55:02.972614179 -0700
@@ -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 -pu make-4.1.90/vpath.c make-fix/vpath.c
--- make-4.1.90/vpath.c	2016-04-23 08:48:40.000000000 -0700
+++ make-fix/vpath.c	2016-04-27 07:43:28.037997227 -0700
@@ -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;
Common subdirectories: make-4.1.90/w32 and make-fix/w32
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to