diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 1b5b4843742..dc56b862660 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -23,6 +23,16 @@ Boston, MA 02111-1307, USA. */ #include #include #include +#if HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include "rtl.h" #include "tree.h" @@ -135,6 +145,9 @@ static int end_of_file; static int nextchar = -1; #endif +#ifdef HANDLE_SYSV_PRAGMA +static int handle_sysv_pragma PROTO((int)); +#endif /* HANDLE_SYSV_PRAGMA */ static int skip_white_space PROTO((int)); static char *extend_token_buffer PROTO((char *)); static int readescape PROTO((int *)); @@ -894,7 +907,7 @@ linenum: /* This function has to be in this file, in order to get at the token types. */ -int +static int handle_sysv_pragma (token) register int token; { @@ -1264,7 +1277,7 @@ yylex () { register struct resword *ptr; - if (ptr = is_reserved_word (token_buffer, p - token_buffer)) + if ((ptr = is_reserved_word (token_buffer, p - token_buffer))) { if (ptr->rid) yylval.ttype = ridpointers[(int) ptr->rid]; diff --git a/gcc/config/sparc/gmon-sol2.c b/gcc/config/sparc/gmon-sol2.c index 9b41c649297..2a5b898353d 100644 --- a/gcc/config/sparc/gmon-sol2.c +++ b/gcc/config/sparc/gmon-sol2.c @@ -44,6 +44,7 @@ static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 5/22/91"; #include #include #include +#include #if 0 #include "sparc/gmon.h" @@ -95,7 +96,9 @@ static int s_scale; #define MSG "No space for profiling buffer(s)\n" -monstartup(lowpc, highpc) +static void moncontrol(); + +void monstartup(lowpc, highpc) char *lowpc; char *highpc; { @@ -201,7 +204,7 @@ _mcleanup() else progname++; - sprintf(buf, "%s/%d.%s", profdir, getpid(), progname); + sprintf(buf, "%s/%ld.%s", profdir, getpid(), progname); proffile = buf; } else { proffile = "gmon.out"; @@ -279,11 +282,10 @@ asm(".global _mcount; _mcount: mov %i7,%o1; mov %o7,%o0;b,a internal_mcount"); /* This is for compatibility with old versions of gcc which used mcount. */ asm(".global mcount; mcount: mov %i7,%o1; mov %o7,%o0;b,a internal_mcount"); -static internal_mcount(selfpc, frompcindex) +static void internal_mcount(selfpc, frompcindex) register char *selfpc; register unsigned short *frompcindex; { - register char *nextframe; register struct tostruct *top; register struct tostruct *prevtop; register long toindex; @@ -410,7 +412,7 @@ overflow: * profiling is what mcount checks to see if * all the data structures are ready. */ -moncontrol(mode) +static void moncontrol(mode) int mode; { if (mode) { diff --git a/gcc/config/svr4.h b/gcc/config/svr4.h index c7fac28beea..e9ee03b6304 100644 --- a/gcc/config/svr4.h +++ b/gcc/config/svr4.h @@ -892,7 +892,7 @@ do { \ register unsigned char *_limited_str = (unsigned char *) (STR); \ register unsigned ch; \ fprintf ((FILE), "\t%s\t\"", STRING_ASM_OP); \ - for (; ch = *_limited_str; _limited_str++) \ + for (; (ch = *_limited_str); _limited_str++) \ { \ register int escape; \ switch (escape = ESCAPES[ch]) \ diff --git a/gcc/cppexp.c b/gcc/cppexp.c index bbb43ac3d36..347ee390fa5 100644 --- a/gcc/cppexp.c +++ b/gcc/cppexp.c @@ -31,14 +31,23 @@ Written by Per Bothner 1994. */ extern char *xmalloc PARAMS ((unsigned)); extern char *xrealloc PARAMS ((void *, unsigned)); -#ifdef MULTIBYTE_CHARS +#ifdef HAVE_STDLIB_H #include +#endif +#ifdef MULTIBYTE_CHARS #include #endif #if HAVE_LIMITS_H # include #endif +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include @@ -306,7 +315,6 @@ cpp_lex (pfile, skip_evaluation) int skip_evaluation; { register int c; - register int namelen; register struct token *toktab; enum cpp_token token; struct operation op; @@ -360,7 +368,7 @@ cpp_lex (pfile, skip_evaluation) It is mostly copied from c-lex.c. */ { register int result = 0; - register num_chars = 0; + register int num_chars = 0; unsigned width = MAX_CHAR_TYPE_SIZE; int wide_flag = 0; int max_chars; diff --git a/gcc/fix-header.c b/gcc/fix-header.c index 3b5ec3a760f..3e235035060 100644 --- a/gcc/fix-header.c +++ b/gcc/fix-header.c @@ -1081,8 +1081,10 @@ main (argc, argv) int inf_fd; struct stat sbuf; int c; - int i, done; - const char *cptr, **pptr; +#ifdef FIXPROTO_IGNORE_LIST + int i; +#endif + const char *cptr; int ifndef_line; int endif_line; long to_read; diff --git a/gcc/pexecute.c b/gcc/pexecute.c index f9690e446e6..38b5874f27c 100644 --- a/gcc/pexecute.c +++ b/gcc/pexecute.c @@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA. */ #include #include +#ifdef HAVE_UNISTD_H +#include +#endif #ifdef IN_GCC #include "gansidecl.h" @@ -637,6 +640,9 @@ pfinish () extern int execv (); extern int execvp (); +#ifdef IN_GCC +extern char * my_strerror(); +#endif int pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags) diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c index 60405bd8a81..8db02fe94a3 100644 --- a/gcc/print-rtl.c +++ b/gcc/print-rtl.c @@ -231,6 +231,7 @@ void print_inline_rtx (outf, x, ind) FILE *outf; rtx x; + int ind; { int oldsaw = sawclose; int oldindent = indent; diff --git a/gcc/profile.c b/gcc/profile.c index 80f4549b69e..81841fb2e75 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -42,6 +42,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include +#ifdef HAVE_STRING_H +#include +#else +#ifdef HAVE_STRINGS_H +#include +#endif +#endif #include "rtl.h" #include "flags.h" #include "insn-flags.h" @@ -184,11 +191,6 @@ instrument_arcs (f, num_blocks, dump_file) int num_instr_arcs = 0; rtx insn; - int neg_one = -1; - int zero = 0; - int inverted; - rtx note; - /* Instrument the program start. */ /* Handle block 0 specially, since it will always be instrumented, but it doesn't have a valid first_insn or branch_insn. We must @@ -679,7 +681,7 @@ branch_prob (f, dump_file) bb_graph[i].first_insn = insn; } else if (code == NOTE) - ; + {;} if (code == CALL_INSN) { diff --git a/gcc/scan.c b/gcc/scan.c index 4f575b38a9f..65689f70aa2 100644 --- a/gcc/scan.c +++ b/gcc/scan.c @@ -49,7 +49,7 @@ sstring_append (dst, src) sstring *src; { register char *d, *s; - register count = SSTRING_LENGTH(src); + register int count = SSTRING_LENGTH(src); MAKE_SSTRING_SPACE(dst, count + 1); d = dst->ptr; s = src->base; @@ -84,6 +84,7 @@ int scan_string (fp, s, init) register FILE *fp; register sstring *s; + int init; { int c; for (;;)