c-lex.c: Include <stdlib.h> and <string.h>/<strings.h>.
/ * c-lex.c: Include <stdlib.h> and <string.h>/<strings.h>. Add prototype for `handle_sysv_pragma', and make it static. Add parentheses around assignment used as truth value. * combine.c (combine_instructions): Protect variable `prev' with macro HAVE_cc0. (can_combine_p): Protect variable `link' with AUTO_INC_DEC. (extract_left_shift): Add parentheses around operand of &. (merge_outer_ops): Avoid an empty body in an else-statement. (gen_rtx_combine): Remove unused variable `i'. * sparc/gmon-sol2.c: Include <fcntl.h>. Make return type of function monstartup `void'. Likewise for internal_mcount. Add `static void' prototype for moncontrol. Reconcile sprintf format vs. args. * sparc/sparc.c: Include <stdlib.h> and <string.h>/<strings.h>. Make return type of function_arg_slotno explicitly `int'. (reg_unused_after): Add parentheses around assignment used as truth value. (save_regs): Add explicit braces to avoid ambiguous `else'. (function_arg_slotno): Add parentheses around && within ||. (function_arg_pass_by_reference): Likewise. (sparc_flat_output_function_prologue): Reconcile fprintf format vs. args. * svr4.h (ASM_OUTPUT_LIMITED_STRING): Add parentheses around assignment used as truth value. * cplus-dem.c: Include <stdlib.h>. (demangle_signature): Avoid an empty body in an else-statement. (do_type): Remove unused variable `lvl'. * cppexp.c: Don't have <stdlib.h> depend on MULTIBYTE_CHARS. Include <string.h>/<strings.h>. (cpp_lex): Remove unused variable `namelen'. (cpp_lex): Explicitly declare `num_chars' as an int. * cpplib.c: Avoid duplicate inclusion of <stdlib.h>, include <unistd.h> instead. Explicitly declare is_system_include returning int. (make_assertion): Remove unused variable `kt'. (cpp_expand_to_buffer): Hide variable `obuf'. (output_line_command): Remove unused variables, `line_end', `line_cmd_buf' and `len'. (macarg): Remove unused variable `arg_start'. (special_symbol): Remove unused variable `i'. Add parentheses around assignment used as truth value. (do_include): Remove unused variables `pcfname' and `retried', hide `pcf' and `pcfbuflimit'. (do_line): Remove unused variable `i'. (finclude): Hide variable `missing_newline'. (cpp_handle_options): Remove unused variable `j'. (read_token_list): Remove unused variable `eofp'. (cpp_error_with_line): Remove unused variable `i'. (cpp_warning_with_line): Likewise. (cpp_pedwarn_with_line): Explicitly declare `column' as int. (cpp_error_from_errno): Remove unused variable `i'. * cse.c (invalidate): Add parentheses around assignment used as truth value. (find_best_addr): Move declaration of variable `our_cost' inside the conditional macro where its used. (fold_rtx): Avoid an empty body in an if-statement. (cse_insn): Wrap variables `this_insn_cc0_mode' and `this_insn_cc0' in macro HAVE_cc0. * dwarf2out.c: Include <stdlib.h> and <string.h>/<string.h>. (ASM_OUTPUT_DWARF_DATA8): Reconcile format vs. args in fprintf's. (output_uleb128): Likewise. (output_sleb128): Likewise. (output_cfi): Likewise. (output_call_frame_info): Remove unused variables `j', `fde_size' and `fde_pad'. (comp_unit_has_inlines): Hide declaration as per rest of file. (size_of_line_prolog): Correct typo in prototype. (add_arange): Likewise. (output_aranges): Likewise. (add_name_and_src_coords_attributes): Likewise. (gen_array_type_die): Likewise. (gen_inlined_subroutine_die): Likewise. (equate_decl_number_to_die): Remove unused variable `i'. (print_die): Reconcile format vs. args in fprintf's. (print_dwarf_line_table): Likewise. (output_die): Likewise. (output_line_info): Likewise. (add_subscript_info): Avoid an empty body in an else-statement. (gen_subprogram_die): Remove unused variable `fp_loc'. * dwarfout.c: Explicitly declare `next_pubname_number' as int. Protect `ordering_attribute' prototype with USE_ORDERING_ATTRIBUTE macro. Protect `src_coords_attribute' prototype with DWARF_DECL_COORDINATES macro. Hide `output_entry_point_die' prototype as in the rest of the file. Likewise for `output_pointer_type_die' and `output_reference_type_die'. Remove prototype for `type_of_for_scope'. (output_unsigned_leb128): Reconcile format vs. args in fprintf. (type_attribute): Add explicit braces to avoid ambiguous `else'. * final.c: Include <stdlib.h> and <string.h>/<strings.h>. (shorten_branches): Protect declaration of tmp_length with SHORTEN_WITH_ADJUST_INSN_LENGTH and ADJUST_INSN_LENGTH macros. (profile_function): Protect declaration of `sval' and `cxt' variables with appropriate macros. (final_scan_insn): Likewise for `note' variable. Add explicit braces to avoid empty body in an if-statement. (output_asm_insn): Move variable `i' inside macro conditional where it is used. Add parentheses around assignment used as truth value. (asm_fprintf) Likewise, likewise. * fix-header.c (main): Remove unused variable `done'. Protect declaration of `i' with FIXPROTO_IGNORE_LIST. * pexecute.c: Include <unistd.h>. Prototype `my_strerror'. * print-rtl.c (print_inline_rtx): Explicitly declare the parameter `ind'. * profile.c: Include <string.h>/<strings.h>. (instrument_arcs): Remove unused variables `note', `inverted', `zero' and `neg_one'. (branch_prob): Avoid empty body in an if-statement. * regclass.c: Include <stdlib.h>. (reg_alternate_class): Explicitly declare parameter `regno'. * regmove.c (regmove_optimize): Remove unused variable `p'. Add parentheses around assignment used as truth value. (find_matches): Remove unused variables `output_operand' and `matching_operand'. (fixup_match_1): Remove statement with no effect: "if (0) ;". * scan.c (sstring_append): Explicitly declare `count' as int. (scan_string): Explicitly declare parameter `init' as int. * sched.c: Include <stdlib.h>. (BLOCKAGE_RANGE): Add parentheses around arithmetic in operand of |. (rank_for_schedule): Add parentheses around assignment used as truth value. (schedule_block): Likewise. (regno_use_in): Likewise. (schedule_insns): Remove unused variable `i'. * toplev.c: Include <stdlib.h> and <string.h>/<strings.h>. (v_message_with_decl): Remove unused variable `n'. (botch): Explicitly declare parameter `s' as char *. (main): Add parentheses around assignment used as truth value. * tree.c (make_node): Protect the variable `kind' with the GATHER_STATISTICS macro. (real_value_from_int_cst): Move variable `e' inside conditional macro area where it is used. (tree_last): Add parentheses around assignment used as truth value. (build1): Protect the variable `kind' with the GATHER_STATISTICS macro. (print_obstack_statistics): Reconcile format vs. args in fprintf. Protect variables `i', `total_nodes', and `total_bytes' with the GATHER_STATISTICS macro. Lots more -W -Wall warnings disappear. From-SVN: r17517
This commit is contained in:
parent
b729186a44
commit
9870475ca0
9 changed files with 55 additions and 20 deletions
17
gcc/c-lex.c
17
gcc/c-lex.c
|
@ -23,6 +23,16 @@ Boston, MA 02111-1307, USA. */
|
|||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <setjmp.h>
|
||||
#if HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#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];
|
||||
|
|
|
@ -44,6 +44,7 @@ static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 5/22/91";
|
|||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#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) {
|
||||
|
|
|
@ -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]) \
|
||||
|
|
14
gcc/cppexp.c
14
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 <stdlib.h>
|
||||
#endif
|
||||
#ifdef MULTIBYTE_CHARS
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -29,6 +29,9 @@ Boston, MA 02111-1307, USA. */
|
|||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#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)
|
||||
|
|
|
@ -231,6 +231,7 @@ void
|
|||
print_inline_rtx (outf, x, ind)
|
||||
FILE *outf;
|
||||
rtx x;
|
||||
int ind;
|
||||
{
|
||||
int oldsaw = sawclose;
|
||||
int oldindent = indent;
|
||||
|
|
|
@ -42,6 +42,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#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)
|
||||
{
|
||||
|
|
|
@ -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 (;;)
|
||||
|
|
Loading…
Add table
Reference in a new issue