aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
AgeCommit message (Collapse)AuthorFilesLines
1998-04-04* Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12Jeff Law1-3/+5
for details. * haifa-sched.c: Mirror recent changes from gcc2. From-SVN: r18984
1998-03-30gcc.c, cccp.c, cpplib.c, collect2.c (GET_ENVIRONMENT): Added.Stan Cox1-5/+9
From-SVN: r18914
1998-03-30More cutover to system.h:Kaveh R. Ghazi1-52/+1
* Makefile.in (cppalloc.o, cpperror.o, cppexp.o, cpphash.o, cpplib.o, cppmain.o, fix-header.o, gcov.o, gen-protos.o, gengenrtl.o, halfpic.o, hash.o, scan-decls.o, scan.o): Depend on system.h. * cpphash.c: Include config.h. * cppalloc.c: Include system.h. Add parameters to various function prototypes. * cpperror.c: Likewise. * cppexp.c: Likewise. * cpphash.c: Likewise. * cpplib.c: Likewise. * cppmain.c: Likewise. * fix-header.c: Likewise. * gcov.c: Likewise. * gen-protos.c: Likewise. * gengenrtl.c: Likewise. * halfpic.c: Likewise. * hash.c: Likewise. * scan-decls.c: Likewise. * scan.c: Likewise. From-SVN: r18911
1998-03-29cpplib.c (cpp_file_line_for_message): Delete unused parameter.Jeffrey A Law1-6/+10
* cpplib.c (cpp_file_line_for_message): Delete unused parameter. All callers changed. (do_sccs): Wrap in an SCCS_DIRECTIVE ifdef. * fix-header.c (cpp_file_line_for_message): Delete unused paramter. All callers changed. From-SVN: r18893
1998-03-18Fix more warnings...Kaveh R. Ghazi1-5/+2
* c-lang.c (finish_file): Wrap variable `void_list_node' with macro test !ASM_OUTPUT_CONSTRUCTOR || !ASM_OUTPUT_DESTRUCTOR. * calls.c (emit_call_1): Wrap variable `already_popped' with macro test !ACCUMULATE_OUTGOING_ARGS. * collect2.c (write_c_file_glob): Wrap function definition in macro test !LD_INIT_SWITCH. * combine.c (try_combine): Wrap variables `cc_use' and `compare_mode' in macro test EXTRA_CC_MODES. * cpplib.c (do_ident): Remove unused variable `len'. (skip_if_group): Remove unused variables `at_beg_of_line' and `after_ident'. (cpp_get_token): Remove unused variable `dummy'. * dbxout.c (scope_labelno): Move static variable definition inside the one function scope where it is used. (dbxout_function_end): Wrap prototype and definition in macro test !NO_DBX_FUNCTION_END. * dwarf2out.c (add_subscript_info): Wrap variable `dimension_number' in macro test !MIPS_DEBUGGING_INFO. * expr.c (expand_builtin_setjmp): Move declaration of variable `i' into the scope where it is used. Wrap empty else-statement body in braces. * fix-header.c: Fix typo in comment. (inf_skip_spaces): Cast results of INF_UNGET to (void). (check_protection, main): Likewise. * flow.c (find_basic_blocks_1): Remove dangling comment text. * function.c (contains): Wrap prototype and definition in macro test HAVE_prologue || HAVE_epilogue. (fixup_var_refs_1): Remove unused variable `width'. * gen-protos.c (main): Remove unused variable `optr'. * haifa-sched.c (debug_control_flow): Remove unused variable `j'. * libgcc2.c (__udiv_w_sdiv): Provide dummy return value of 0. (__sjpopnthrow): Remove unused variable `jmpbuf'. (__throw): Remove unused variable `val'. * protoize.c: Check for a previously existing definition before defining *_OK macros. * scan-decls.c (scan_decls): Remove unused variable `old_written'. From-SVN: r18654
1998-01-27c-lex.c: Include <stdlib.h> and <string.h>/<strings.h>.Kaveh R. Ghazi1-20/+14
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
1997-12-06Merge from gcc-2.8Jeff Law1-141/+128
From-SVN: r16987
1997-11-13cccp.c, cpplib.c (compare_defs): Don't complain about arg name respellings ↵Paul Eggert1-3/+5
unless pedantic. * cccp.c, cpplib.c (compare_defs): Don't complain about arg name respellings unless pedantic. * cpplib.c (compare_defs): Accept pfile as new arg. All callers changed. Bring over from the FSF. From-SVN: r16474
1997-11-02Update mainline egcs to gcc2 snapshot 971021.Jeff Law1-103/+129
From-SVN: r16278
1997-09-11From Fred Fish, fix BeOS (I assume) related problem with mixing char pointers.Fred Fish1-4/+4
* cpplib.c (quote_string): Cast first arg of sprintf call from "unsigned char *" to "char *". (output_line_command): Ditto. (macroexpand): Ditto. (do_line): Cast atoi arg from "unsigned char *" to "char *". From-SVN: r15418
1997-09-01cccp.c (sys_errlist): Remove special 4.4bsd declaration.Jeffrey A Law1-4/+0
* cccp.c (sys_errlist): Remove special 4.4bsd declaration. * collect2.c (sys_errlist): Likewise. * cpplib.c (sys_errlist): Likewise. * gcc.c (sys_errlist): Likewise. * protoize (sys_errlist): Likewise. * configure.in: Check for strerror. * xm-freebsd.h (HAVE_STRERROR): Remove definition. * xm-gnu.h (HAVE_STRERROR): Likewise. * xm-linux.h (HAVE_STRERROR): Likewise. * xm-netbsd.h (HAVE_STRERROR): Likewise. * xm-bsd386.h (HAVE_STRERROR): Likewise. * xm-cygwin32.h (HAVE_STRERROR): Likewise. * xm-dos.h (HAVE_STRERROR): Likewise. * xm-mingw32.h (HAVE_STRERROR): Likewise. * xm-pa.h (HAVE_STRERROR): Likewise. * xm-papro.h (HAVE_STRERROR): Likewise. * xm-sysv4.h (HAVE_STRERROR): Likewise. * configure, config.in: Rebuilt. Remove the need to define HAVE_STRERROR for each host port. From-SVN: r15011
1997-05-18(safe_read): If MAX_READ_LEN is defined, limit incremental readRichard Kenner1-3/+11
attempts to that amount. From-SVN: r14093
1997-05-06reformat a little to match GNU coding standards.Mike Stump1-12/+10
From-SVN: r14023
1997-04-13(do_include): Diagnose #import and #include_next if pedantic and if not in a ↵Richard Kenner1-1/+11
system header. (do_include): Diagnose #import and #include_next if pedantic and if not in a system header. (do_warning): #warning now causes an error if -pedantic-errors is given; this is needed since #warning isn't ANSI. From-SVN: r13887
1997-04-13(cpp_handle_options): Set warn_undef from -Wundef and -Wno-undef.Richard Kenner1-0/+4
From-SVN: r13879
1997-03-19(do_error, do_warning): Fix memory leak.Richard Kenner1-2/+2
From-SVN: r13752
1997-03-19(unsafe_chars): `p' is unsafe before `-' or `+', since it might generate a ↵Richard Kenner1-10/+17
C9X-style hexadecimal floating-point number. (unsafe_chars): `p' is unsafe before `-' or `+', since it might generate a C9X-style hexadecimal floating-point number. (cpp_handle_options): Set c89 option to 1 if -lang-c89. From-SVN: r13749
1997-02-16(special_symbol, check_macro_name, collect_expansion): Don't treat "L"Richard Kenner1-4/+9
in "L'...'" as identifier. From-SVN: r13660
1997-01-03(macroexpand): Delete any no-reexpansion marker that follows an identifier at...Richard Kenner1-2/+7
(macroexpand): Delete any no-reexpansion marker that follows an identifier at the beginning of an argument that is concatenated with what precedes it. From-SVN: r13356
1996-12-07(LOCAL_INCLUDE_DIR): Remove default definition.Richard Kenner1-4/+6
(include_defaults_array): Do not use LOCAL_INCLUDE_DIR or TOOL_INCLUDE_DIR if they are not defined. From-SVN: r13238
1996-10-09(cpp_options_init): Ignore DOLLARS_IN_IDENTIFIERS.Richard Kenner1-3/+3
(parse_name): Diagnose $ in identifier if pedantic. (cpp_handle_options): -traditional no longer messes with dollars_in_ident. From-SVN: r12935
1996-07-03formatting tweaksMike Stump1-106/+113
From-SVN: r12390
1996-06-07cpplib.c (xcalloc): From from cppalloc.c.Per Bothner1-13/+43
* cpplib.c (xcalloc): From from cppalloc.c. * cpplib.c (cpp_push_buffer): If recursion too deap, return NULL rather than exiting with fatal. (make_assertion, cpp_expand_to_buffer, push_macro_expansion, do_include, cpp_start_rea): Handle NULL return from cpp_push_buffer. (output_line_command): Update position even if no_output. (parse_clear_mark): Use fatal instead of abort. From-SVN: r12207
1996-06-06cpplib.c (init_parse_option): Renamed to cpp_options_init.Per Bothner1-60/+56
* cpplib.c (init_parse_option): Renamed to cpp_options_init. (push_parse_file): Renamed to ... (cpp_start_read): Change to return 1 on success, 0 on failure. (init_parse_file): Renamed to cpp_reader_init. * cpplib.c (cpp_start_read, cpp_handle_options, cpp_finish, parse_goto_mark, parse_move_mark): Use cpp_fatal rather than fatal. * cpplib.c (newline_fix): Remove unused function. From-SVN: r12202
1996-06-05cpplib.h, cpplib.c: Remove support for !STATIC_BUFFERS.Per Bothner1-78/+48
* cpplib.h, cpplib.c: Remove support for !STATIC_BUFFERS. * cpplib.c (special_symbol, do_once, do_include, cpp_get_token): Compare cpp_buffer against CPP_NULL_BUFFER, not NULL. * cpplib.c (dump_special_to_buffer): New function. (initialize_builtins): Use it. From-SVN: r12170
1996-05-07(skip_comment, handle_directive): Don't use uninitialized vars.Paul Eggert1-2/+4
From-SVN: r11948
1996-05-05(default_include): For C++, also search OLD_GPLUSPLUS_INCLUDE_DIR.Richard Kenner1-1/+2
From-SVN: r11931
1996-01-27(sys/param.h): Delete inclusion.Doug Evans1-1/+0
This was a CYGNUS LOCAL patch accidentally installed at the FSF. From-SVN: r11117
1995-11-04(finclude): Set current input pointer when input is not a regularRichard Kenner1-0/+1
file. From-SVN: r10549
1995-07-01(output_line_command): If not emitting #line directives delayRichard Kenner1-2/+4
returning until after adjust_position has been called. From-SVN: r10101
1995-06-28(progname): Remove definition from here.Richard Kenner1-4/+0
From-SVN: r10082
1995-06-15Update FSF address.Richard Kenner1-1/+1
From-SVN: r9959
1995-06-08(cpp_push_buffer): Include filename in error message.Richard Kenner1-1/+1
From-SVN: r9901
1995-05-23(initialize_builtins): Add missing parm to timestamp call.Richard Kenner1-1/+1
From-SVN: r9778
1995-05-19* cpplib.c (collect_expansion): Don't escape '@' inside string.Per Bothner1-1/+4
From-SVN: r9744
1995-05-16Use FATAL_EXIT_CODE instead of FAILURE_EXIT_CODE.Richard Kenner1-2/+2
From-SVN: r9725
1995-05-16Fix typos in comments.Richard Kenner1-3/+3
From-SVN: r9711
1995-05-12Fix reporting of unterminated strings.Per Bothner1-123/+37
From-SVN: r9637
1995-05-11cpplib.c (line_for_error): Make it work; add extra parameter.Per Bothner1-41/+32
* cpplib.c (line_for_error): Make it work; add extra parameter. (skip_quoted_string, cpp_get_token): Update calls to line_for_error. (macroexpand): Remember initial line so we can report it if the call is unterminated. Also, simplify error logic slightly. (do_include): Cast alloca return value, to avoid pcc warning. From-SVN: r9635
1995-04-30Bunch of fixes. See ChangeLog.Per Bothner1-92/+181
From-SVN: r9552
1995-04-27Don't include <sys/stat.h> twice.Richard Kenner1-4/+2
(cpp_grow_buffer, init_parse_file): Cast {xmalloc,xrealloc} for token_buffer to U_CHAR* instead of char*. From-SVN: r9507
1995-04-17cpplib.c: Rename make_definition to cpp_define.Per Bothner1-9/+7
* cpplib.c: Rename make_definition to cpp_define. * cpplib.c (special_symbol): For T_SPECLINE, calculate __LINE__ in enclosing file buffer, not current buffer (if macro expanding). (cpp_get_token): Fix thinko (in code for chopping unneeded space). From-SVN: r9403
1995-04-11Bunch of little fixes. See ChangeLog.Per Bothner1-59/+62
From-SVN: r9360
1995-04-10(init_parse_options, cpp_reader): Cast args to bcopy, bcmp, and bzero to char *.Richard Kenner1-5/+6
(init_parse_options, cpp_reader): Cast args to bcopy, bcmp, and bzero to char *. (add_import, push_parse_file, init_parse_file): Likewise. From-SVN: r9352
1995-04-07* cpplib.c (bcopy, bzero, bcmp): Remove #undefs.Per Bothner1-5/+0
From-SVN: r9323
1995-04-06cpplib.c (SELF_DIR_DUMMY): New macro.Per Bothner1-4/+10
* cpplib.c (SELF_DIR_DUMMY): New macro. (do_include): Don't pass searchptr to finclude if it is dsp, since that is on the stack, and would cause a dangling pointer. If handling #include_next, recognize SELF_DIR_DUMMY. From-SVN: r9320
1995-04-05Moved 'high-level' error functions from cpperror.c to cpplib.c.Per Bothner1-2/+220
From-SVN: r9315
1995-03-21Merged in earlier cccp.c changesPer Bothner1-44/+68
From-SVN: r9218
1995-03-16Initial revisionPer Bothner1-0/+7288
From-SVN: r9191