Commit b729186a by Jeff Law

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: r17516
parent 2d8b0f3a
...@@ -465,7 +465,10 @@ combine_instructions (f, nregs) ...@@ -465,7 +465,10 @@ combine_instructions (f, nregs)
rtx f; rtx f;
int nregs; int nregs;
{ {
register rtx insn, next, prev; register rtx insn, next;
#ifdef HAVE_cc0
register rtx prev;
#endif
register int i; register int i;
register rtx links, nextlinks; register rtx links, nextlinks;
...@@ -823,7 +826,10 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc) ...@@ -823,7 +826,10 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc)
{ {
int i; int i;
rtx set = 0, src, dest; rtx set = 0, src, dest;
rtx p, link; rtx p;
#ifdef AUTO_INC_DEC
rtx, link;
#endif
int all_adjacent = (succ ? (next_active_insn (insn) == succ int all_adjacent = (succ ? (next_active_insn (insn) == succ
&& next_active_insn (succ) == i3) && next_active_insn (succ) == i3)
: next_active_insn (insn) == i3); : next_active_insn (insn) == i3);
...@@ -5739,7 +5745,7 @@ extract_left_shift (x, count) ...@@ -5739,7 +5745,7 @@ extract_left_shift (x, count)
/* If we can safely shift this constant and we find the inner shift, /* If we can safely shift this constant and we find the inner shift,
make a new operation. */ make a new operation. */
if (GET_CODE (XEXP (x,1)) == CONST_INT if (GET_CODE (XEXP (x,1)) == CONST_INT
&& (INTVAL (XEXP (x, 1)) & (((HOST_WIDE_INT) 1 << count)) - 1) == 0 && (INTVAL (XEXP (x, 1)) & ((((HOST_WIDE_INT) 1 << count)) - 1)) == 0
&& (tem = extract_left_shift (XEXP (x, 0), count)) != 0) && (tem = extract_left_shift (XEXP (x, 0), count)) != 0)
return gen_binary (code, mode, tem, return gen_binary (code, mode, tem,
GEN_INT (INTVAL (XEXP (x, 1)) >> count)); GEN_INT (INTVAL (XEXP (x, 1)) >> count));
...@@ -8126,7 +8132,7 @@ merge_outer_ops (pop0, pconst0, op1, const1, mode, pcomp_p) ...@@ -8126,7 +8132,7 @@ merge_outer_ops (pop0, pconst0, op1, const1, mode, pcomp_p)
op0 = SET; op0 = SET;
else /* op1 == XOR */ else /* op1 == XOR */
/* (a ^ b) | b == a | b */ /* (a ^ b) | b == a | b */
; {;}
break; break;
case XOR: case XOR:
...@@ -9128,7 +9134,7 @@ gen_rtx_combine VPROTO((enum rtx_code code, enum machine_mode mode, ...)) ...@@ -9128,7 +9134,7 @@ gen_rtx_combine VPROTO((enum rtx_code code, enum machine_mode mode, ...))
va_list p; va_list p;
int n_args; int n_args;
rtx args[3]; rtx args[3];
int i, j; int j;
char *fmt; char *fmt;
rtx rt; rtx rt;
struct undo *undo; struct undo *undo;
......
...@@ -52,6 +52,16 @@ Boston, MA 02111-1307, USA. */ ...@@ -52,6 +52,16 @@ Boston, MA 02111-1307, USA. */
#endif #endif
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.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 "tree.h" #include "tree.h"
#include "rtl.h" #include "rtl.h"
...@@ -837,7 +847,11 @@ shorten_branches (first) ...@@ -837,7 +847,11 @@ shorten_branches (first)
insn = NEXT_INSN (insn)) insn = NEXT_INSN (insn))
{ {
int new_length; int new_length;
#ifdef SHORTEN_WITH_ADJUST_INSN_LENGTH
#ifdef ADJUST_INSN_LENGTH
int tmp_length; int tmp_length;
#endif
#endif
uid = INSN_UID (insn); uid = INSN_UID (insn);
insn_addresses[uid] = insn_current_address; insn_addresses[uid] = insn_current_address;
...@@ -1063,8 +1077,14 @@ profile_function (file) ...@@ -1063,8 +1077,14 @@ profile_function (file)
FILE *file; FILE *file;
{ {
int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE); int align = MIN (BIGGEST_ALIGNMENT, LONG_TYPE_SIZE);
#if defined(ASM_OUTPUT_REG_PUSH)
#if defined(STRUCT_VALUE_INCOMING_REGNUM) || defined(STRUCT_VALUE_REGNUM)
int sval = current_function_returns_struct; int sval = current_function_returns_struct;
#endif
#if defined(STATIC_CHAIN_INCOMING_REGNUM) || defined(STATIC_CHAIN_REGNUM)
int cxt = current_function_needs_context; int cxt = current_function_needs_context;
#endif
#endif /* ASM_OUTPUT_REG_PUSH */
data_section (); data_section ();
ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT)); ASM_OUTPUT_ALIGN (file, floor_log2 (align / BITS_PER_UNIT));
...@@ -1683,7 +1703,9 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -1683,7 +1703,9 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
register rtx body = PATTERN (insn), set; register rtx body = PATTERN (insn), set;
int insn_code_number; int insn_code_number;
char *template; char *template;
#ifdef HAVE_cc0
rtx note; rtx note;
#endif
/* An INSN, JUMP_INSN or CALL_INSN. /* An INSN, JUMP_INSN or CALL_INSN.
First check for special kinds that recog doesn't recognize. */ First check for special kinds that recog doesn't recognize. */
...@@ -1857,7 +1879,9 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -1857,7 +1879,9 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
actions in these insns and the CC must be marked as being actions in these insns and the CC must be marked as being
clobbered by the function. */ clobbered by the function. */
if (GET_CODE (XVECEXP (body, 0, 0)) == CALL_INSN) if (GET_CODE (XVECEXP (body, 0, 0)) == CALL_INSN)
CC_STATUS_INIT; {
CC_STATUS_INIT;
}
/* Following a conditional branch sequence, we have a new basic /* Following a conditional branch sequence, we have a new basic
block. */ block. */
...@@ -2575,7 +2599,7 @@ output_asm_insn (template, operands) ...@@ -2575,7 +2599,7 @@ output_asm_insn (template, operands)
rtx *operands; rtx *operands;
{ {
register char *p; register char *p;
register int c, i; register int c;
/* An insn may return a null string template /* An insn may return a null string template
in a case where no assembler code is needed. */ in a case where no assembler code is needed. */
...@@ -2589,7 +2613,7 @@ output_asm_insn (template, operands) ...@@ -2589,7 +2613,7 @@ output_asm_insn (template, operands)
ASM_OUTPUT_OPCODE (asm_out_file, p); ASM_OUTPUT_OPCODE (asm_out_file, p);
#endif #endif
while (c = *p++) while ((c = *p++))
switch (c) switch (c)
{ {
case '\n': case '\n':
...@@ -2607,16 +2631,20 @@ output_asm_insn (template, operands) ...@@ -2607,16 +2631,20 @@ output_asm_insn (template, operands)
#ifdef ASSEMBLER_DIALECT #ifdef ASSEMBLER_DIALECT
case '{': case '{':
/* If we want the first dialect, do nothing. Otherwise, skip {
DIALECT_NUMBER of strings ending with '|'. */ register int i;
for (i = 0; i < dialect_number; i++)
{ /* If we want the first dialect, do nothing. Otherwise, skip
while (*p && *p++ != '|') DIALECT_NUMBER of strings ending with '|'. */
; for (i = 0; i < dialect_number; i++)
{
while (*p && *p++ != '|')
;
if (*p == '|') if (*p == '|')
p++; p++;
} }
}
break; break;
case '|': case '|':
...@@ -2904,7 +2932,6 @@ asm_fprintf VPROTO((FILE *file, char *p, ...)) ...@@ -2904,7 +2932,6 @@ asm_fprintf VPROTO((FILE *file, char *p, ...))
va_list argptr; va_list argptr;
char buf[10]; char buf[10];
char *q, c; char *q, c;
int i;
VA_START (argptr, p); VA_START (argptr, p);
...@@ -2915,21 +2942,25 @@ asm_fprintf VPROTO((FILE *file, char *p, ...)) ...@@ -2915,21 +2942,25 @@ asm_fprintf VPROTO((FILE *file, char *p, ...))
buf[0] = '%'; buf[0] = '%';
while (c = *p++) while ((c = *p++))
switch (c) switch (c)
{ {
#ifdef ASSEMBLER_DIALECT #ifdef ASSEMBLER_DIALECT
case '{': case '{':
/* If we want the first dialect, do nothing. Otherwise, skip {
DIALECT_NUMBER of strings ending with '|'. */ int i;
for (i = 0; i < dialect_number; i++)
{
while (*p && *p++ != '|')
;
if (*p == '|') /* If we want the first dialect, do nothing. Otherwise, skip
p++; DIALECT_NUMBER of strings ending with '|'. */
for (i = 0; i < dialect_number; i++)
{
while (*p && *p++ != '|')
;
if (*p == '|')
p++;
} }
}
break; break;
case '|': case '|':
......
...@@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */ ...@@ -25,6 +25,9 @@ Boston, MA 02111-1307, USA. */
#include "config.h" #include "config.h"
#include <stdio.h> #include <stdio.h>
#if HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include "rtl.h" #include "rtl.h"
#include "hard-reg-set.h" #include "hard-reg-set.h"
#include "flags.h" #include "flags.h"
...@@ -598,6 +601,7 @@ reg_preferred_class (regno) ...@@ -598,6 +601,7 @@ reg_preferred_class (regno)
enum reg_class enum reg_class
reg_alternate_class (regno) reg_alternate_class (regno)
int regno;
{ {
if (prefclass == 0) if (prefclass == 0)
return ALL_REGS; return ALL_REGS;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment