diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1998-01-27 22:11:55 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-01-27 15:11:55 -0700 |
commit | 5e9defae4f3e7422d3f0fa04fb16e29b676c0d29 (patch) | |
tree | d453b7dadb74745113d0a30cdacc0fab3d0aacfe /gcc/cpplib.c | |
parent | 9870475ca00df8883f60db6e569a06bcc9274c84 (diff) | |
download | gcc-5e9defae4f3e7422d3f0fa04fb16e29b676c0d29.zip gcc-5e9defae4f3e7422d3f0fa04fb16e29b676c0d29.tar.gz gcc-5e9defae4f3e7422d3f0fa04fb16e29b676c0d29.tar.bz2 |
c-lex.c: Include <stdlib.h> and <string.h>/<strings.h>.
d
* 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: r17518
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 9cfd3ac..f5ca073 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -59,8 +59,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # include <limits.h> #endif -#ifdef HAVE_STDLIB_H -# include <stdlib.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> #endif #ifdef HAVE_STRING_H @@ -271,7 +271,7 @@ extern void fancy_abort (); #endif static int lookup_import (); static int redundant_include_p (); -static is_system_include (); +static int is_system_include (); static struct file_name_map *read_name_map (); static char *read_filename_string (); static int open_include_file (); @@ -615,7 +615,6 @@ make_assertion (pfile, option, str) char *option; U_CHAR *str; { - struct directive *kt; U_CHAR *buf, *p, *q; /* Copy the entire option so we can modify it. */ @@ -1946,7 +1945,9 @@ cpp_expand_to_buffer (pfile, buf, length) int length; { register cpp_buffer *ip; +#if 0 cpp_buffer obuf; +#endif U_CHAR *limit = buf + length; U_CHAR *buf1; #if 0 @@ -2087,8 +2088,6 @@ output_line_command (pfile, conditional, file_change) int conditional; enum file_change_code file_change; { - int len; - char *line_cmd_buf, *line_end; long line, col; cpp_buffer *ip = CPP_BUFFER (pfile); @@ -2180,7 +2179,6 @@ macarg (pfile, rest_args) { int paren = 0; enum cpp_token token; - long arg_start = CPP_WRITTEN (pfile); char save_put_out_comments = CPP_OPTIONS (pfile)->put_out_comments; CPP_OPTIONS (pfile)->put_out_comments = 0; @@ -2298,7 +2296,7 @@ special_symbol (hp, pfile) cpp_reader *pfile; { char *buf; - int i, len; + int len; int true_indepth; cpp_buffer *ip = NULL; struct tm *timebuf; @@ -2438,7 +2436,7 @@ special_symbol (hp, pfile) goto oops; if (ip->cur[0] == 'L' && (ip->cur[1] == '\'' || ip->cur[1] == '"')) goto oops; - if (hp = cpp_lookup (pfile, ip->cur, -1, -1)) + if ((hp = cpp_lookup (pfile, ip->cur, -1, -1))) { #if 0 if (pcp_outfile && pcp_inside_if @@ -3105,7 +3103,6 @@ do_include (pfile, keyword, unused1, unused2) int skip_dirs = (keyword->type == T_INCLUDE_NEXT); char *fname; /* Dynamically allocated fname buffer */ char *pcftry; - char *pcfname; U_CHAR *fbeg, *fend; /* Beginning and end of fname */ enum cpp_token token; @@ -3119,12 +3116,12 @@ do_include (pfile, keyword, unused1, unused2) int f; /* file number */ - int retried = 0; /* Have already tried macro - expanding the include line */ int angle_brackets = 0; /* 0 for "...", 1 for <...> */ - int pcf = -1; char *pcfbuf; +#if 0 + int pcf = -1; char *pcfbuflimit; +#endif int pcfnum; f= -1; /* JF we iz paranoid! */ @@ -3730,7 +3727,6 @@ do_line (pfile, keyword) long old_written = CPP_WRITTEN (pfile); enum file_change_code file_change = same_file; enum cpp_token token; - int i; token = get_directive_token (pfile); @@ -5602,7 +5598,9 @@ finclude (pfile, f, fname, system_header_p, dirptr) long i; int length; cpp_buffer *fp; /* For input stack frame */ +#if 0 int missing_newline = 0; +#endif if (fstat (f, &st) < 0) { @@ -6657,7 +6655,6 @@ cpp_handle_options (pfile, argc, argv) Let's include also any that were specified earlier on the command line. That way we can get rid of any that were passed automatically in from GCC. */ - int j; opts->inhibit_predefs = 1; for (ptr = &opts->pending; *ptr != NULL; ) { @@ -7136,7 +7133,7 @@ read_token_list (pfile, error_flag) { struct arglist *temp; long name_written = CPP_WRITTEN (pfile); - int eofp = 0; int c; + int c; cpp_skip_hspace (pfile); @@ -7419,7 +7416,6 @@ cpp_error_with_line (pfile, line, column, msg, arg1, arg2, arg3) char *msg; char *arg1, *arg2, *arg3; { - int i; cpp_buffer *ip = cpp_file_buffer (pfile); cpp_print_containing_files (pfile); @@ -7437,7 +7433,6 @@ cpp_warning_with_line (pfile, line, column, msg, arg1, arg2, arg3) char *msg; char *arg1, *arg2, *arg3; { - int i; cpp_buffer *ip; if (CPP_OPTIONS (pfile)->inhibit_warnings) @@ -7459,7 +7454,7 @@ cpp_warning_with_line (pfile, line, column, msg, arg1, arg2, arg3) void cpp_pedwarn_with_line (pfile, line, column, msg, arg1, arg2, arg3) cpp_reader *pfile; - int line; + int line, column; char *msg; char *arg1, *arg2, *arg3; { @@ -7545,7 +7540,6 @@ cpp_error_from_errno (pfile, name) cpp_reader *pfile; char *name; { - int i; cpp_buffer *ip = cpp_file_buffer (pfile); cpp_print_containing_files (pfile); |