+Sun Jun 28 08:57:09 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * configure.in (GCC_NEED_DECLARATIONS): Add strerror, getcwd and
+ getwd.
+
+ * acconfig.m4: Add stubs for NEED_DECLARATION_STRERROR,
+ NEED_DECLARATION_GETCWD and NEED_DECLARATION_GETWD.
+
+ * cccp.c: Remove strerror()/sys_nerr/sys_errlist decls.
+ (my_strerror): Add prototype and make it static.
+
+ * collect2.c: Likewise.
+
+ * cpplib.c: Likewise.
+
+ * gcc.c: Likewise, but keep `my_strerror' extern.
+
+ * protoize.c: Likewise.
+
+ * pexecute.c (my_strerror): Add argument to prototype.
+
+ * system.h: Add prototypes for getcwd, getwd and strerror. Add
+ extern decls for sys_nerr and sys_errlist. Make abort decl
+ explicitly extern.
+
+ * getpwd.c: Remove decls for getwd and getcwd.
+
Sun Jun 28 02:11:16 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
/* Whether abort must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_ABORT
+
+/* Whether strerror must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_STRERROR
+
+/* Whether getcwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETCWD
+
+/* Whether getwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETWD
@TOP@
extern char *version_string;
extern char *update_path PROTO((char *, char *));
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
HOST_WIDE_INT parse_escape PROTO((char **, HOST_WIDE_INT));
HOST_WIDE_INT parse_c_expression PROTO((char *, int));
\f
static int change_newlines PROTO((U_CHAR *, int));
-char *my_strerror PROTO((int));
+static char *my_strerror PROTO((int));
void error PRINTF_PROTO_1((char *, ...));
static void verror PROTO((char *, va_list));
static void error_from_errno PROTO((char *));
/* my_strerror - return the descriptive text associated with an
`errno' code. */
-char *
+static char *
my_strerror (errnum)
int errnum;
{
#include <process.h>
#endif
-#ifndef HAVE_STRERROR
-extern char *sys_errlist[];
-extern int sys_nerr;
-#else
-char *strerror();
-#endif
-
/* Obstack allocation and deallocation routines. */
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
static char *libexts[3] = {"a", "so", NULL}; /* possible library extentions */
#endif
+static char *my_strerror PROTO((int));
static void handler PROTO((int));
static int is_ctor_dtor PROTO((char *));
static char *find_a_file PROTO((struct path_prefix *, char *));
}
#endif
-char *
+static char *
my_strerror (e)
int e;
{
/* Whether abort must be declared even if <stdlib.h> is included. */
#undef NEED_DECLARATION_ABORT
+/* Whether strerror must be declared even if <string.h> is included. */
+#undef NEED_DECLARATION_STRERROR
+
+/* Whether getcwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETCWD
+
+/* Whether getwd must be declared even if <unistd.h> is included. */
+#undef NEED_DECLARATION_GETWD
+
/* Define if you don't have vprintf but do have _doprnt. */
#undef HAVE_DOPRNT
for ac_func in malloc realloc calloc free bcopy bzero bcmp \
- index rindex getenv atol sbrk abort atof
+ index rindex getenv atol sbrk abort atof strerror getcwd getwd
do
echo $ac_n "checking whether $ac_func must be declared""... $ac_c" 1>&6
echo "configure:1952: checking whether $ac_func must be declared" >&5
GCC_FUNC_PRINTF_PTR
GCC_NEED_DECLARATIONS(malloc realloc calloc free bcopy bzero bcmp \
- index rindex getenv atol sbrk abort atof)
+ index rindex getenv atol sbrk abort atof strerror getcwd getwd)
AC_DECL_SYS_SIGLIST
char *xmalloc ();
extern void cpp_hash_cleanup PARAMS ((cpp_reader *));
+static char *my_strerror PROTO ((int));
static void add_import PROTO ((cpp_reader *, int, char *));
static void append_include_chain PROTO ((cpp_reader *,
struct file_name_list *,
va_end(ap);
}
-#ifndef VMS
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#else /* HAVE_STRERROR */
-char *strerror ();
-#endif
-#else /* VMS */
-char *strerror (int,...);
-#endif
-
/* my_strerror - return the descriptive text associated with an
`errno' code. */
-char *
+static char *
my_strerror (errnum)
int errnum;
{
#endif
extern char *choose_temp_base PROTO((void));
-
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#else
-extern char *strerror();
-#endif
+extern char *my_strerror PROTO((int));
#ifndef HAVE_KILL
#define kill(p,s) raise(s)
the few exceptions to the general rule here. */
#if !(defined (POSIX) || defined (USG) || defined (VMS)) || defined (HAVE_GETWD)
-extern char *getwd ();
#define getcwd(buf,len) getwd(buf)
#ifdef MAXPATHLEN
#define GUESSPATHLEN (MAXPATHLEN + 1)
#define GUESSPATHLEN 100
#endif
#else /* (defined (USG) || defined (VMS)) */
-extern char *getcwd ();
/* We actually use this as a starting point, not a limit. */
#define GUESSPATHLEN 100
#endif /* (defined (USG) || defined (VMS)) */
extern int execv ();
extern int execvp ();
#ifdef IN_GCC
-extern char * my_strerror();
+extern char * my_strerror PROTO ((int));
#endif
int
#include "getopt.h"
#undef getopt
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#else
-extern char *strerror();
-#endif
-
extern char *version_string;
/* Systems which are compatible only with POSIX 1003.1-1988 (but *not*
extern char *getpwd ();
extern char *choose_temp_base PROTO ((void));
+extern char * my_strerror PROTO ((int));
extern int pexecute PROTO ((const char *, char * const *, const char *,
const char *, char **, char **, int));
extern void free ();
#endif
+#ifdef NEED_DECLARATION_GETCWD
+extern char *getcwd ();
+#endif
+
#ifdef NEED_DECLARATION_GETENV
extern char *getenv ();
#endif
+#ifdef NEED_DECLARATION_GETWD
+extern char *getwd ();
+#endif
+
#ifdef NEED_DECLARATION_SBRK
extern char *sbrk ();
#endif
+#ifdef HAVE_STRERROR
+# ifdef NEED_DECLARATION_STRERROR
+# ifndef strerror
+extern char *strerror ();
+# endif
+# endif
+#else /* ! HAVE_STRERROR */
+extern int sys_nerr;
+extern char *sys_errlist[];
+#endif /* HAVE_STRERROR */
+
/* HAVE_VOLATILE only refers to the stage1 compiler. We also check
__STDC__ and assume gcc sets it and has volatile in stage >=2. */
#if !defined(HAVE_VOLATILE) && !defined(__STDC__) && !defined(volatile)
#ifdef USE_SYSTEM_ABORT
# ifdef NEED_DECLARATION_ABORT
-void abort ();
+extern void abort ();
# endif
#else
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)