Commit Graph

78 Commits

Author SHA1 Message Date
Zack Weinberg c56c2073a6 cpplib.h (CPP_POP, [...]): Delete.
* cpplib.h (CPP_POP, parse_cleanup_t): Delete.
	(cpp_buffer): Remove cleanup, seen_eof, manual_pop members.

	* cppfiles.c (file_cleanup): Delete.
	* cpphash.c (macro_cleanup): Delete.
	(collect_objlike_expansion, collect_funlike_expansion,
	macarg, scan_arguments): Remove CPP_POP case.

	* cpplex.c (null_cleanup): Delete.
	(cpp_pop_buffer): Do the work that was done in the cleanups
	here.  Call _cpp_unwind_if_stack from here.
	(_cpp_expand_to_buffer, cpp_scan_buffer_nooutput,
	cpp_scan_buffer): Run until we see CPP_EOF and the top of
	stack is the buffer _below_ the one we stacked.
	(cpp_get_token): Always pop an exhausted buffer.  Return
	CPP_EOF unless it's a macro buffer.  Don't call _cpp_handle_eof.
	* cpplib.c (skip_if_group): Don't call cpp_get_token to
	increment the line number.
	(_cpp_handle_eof): Rename to _cpp_unwind_if_stack.

	* fix-header.c (read_scan_file) [parsing getchar()]: Run until
	we see CPP_EOF and the top of stack is the buffer _below_ the
	one we stacked.
	* scan-decls.c: Likewise.

From-SVN: r33611
2000-05-02 16:09:12 +00:00
Zack Weinberg 6d2c2047b5 cpplex.c (cpp_idcmp): New function.
* cpplex.c (cpp_idcmp): New function.
	* cpplib.h: Prototype it.
	* scan_decls.c (scan_decls): Use it to inspect token names.
	* fix-header.c (read_scan_file): Likewise.  Set system_header_p on
	the file being run through the preprocessor.
	(check_macro_names): Provide length of token to cpp_defined.

	* Makefile.in: Remove stale warning message.

From-SVN: r33552
2000-04-30 17:30:25 +00:00
Zack Weinberg f2d5f0cca2 cpplex.c (cpp_output_tokens, [...]): New public interfaces.
* cpplex.c (cpp_output_tokens, cpp_scan_buffer_nooutput): New public
	interfaces.
	(safe_fwrite, output_line_command): New static functions.
	(cpp_expand_to_buffer): Now private to cpplib.
	(cpp_scan_buffer): Take a printer.

	* cpphash.h: Update prototypes.
	* cpplib.h: Update prototypes.
	(cpp_printer): New.
	(cpp_buffer): Remove last_nominal_fname.
	(cpp_reader): Remove lineno.

	* cppmain.c: Use a cpp_printer.
	* fix-header.c: No need to inhibit line commands.  Call
	cpp_start_read with no printer.

	* cpperror.c (cpp_notice_from_errno): Provide default name.
	* cppfiles.c (make_IHASH, _cpp_fake_ihash): New functions.
	(find_include_file, cpp_read_file): Use make_IHASH.
	(file_cleanup): Set control_macro and clear
	input_stack_listing_current here.
	(_cpp_execute_include): Don't output entering-file marker.
	* cpphash.c (special_symbol): Look for the line number in the
	buffer, not the reader.
	(_cpp_macroexpand): No need to disable line commands.
	(_cpp_dump_definition): No need to generate line commands.
	(dump_hash_helper): Remove excess newline from output.
	* cppinit.c (dump_special_to_buffer): No need to generate line
	commands.
	(cpp_printer_init): New.
	(cpp_start_read): Take a printer, and start it up if it's not
	NULL.  No need to generate line commands.
	(cpp_finish): Expect no buffers stacked at all.  Take a
	printer argument, and flush the output buffer if it's not
	NULL.
	* cpplex.c (_cpp_lex_token): Return EOF if there's no buffer.
	Don't put two hashes at the beginning of an assertion.
	(cpp_get_token): Don't increment pfile->lineno or emit line
	commands here.  Return EOF if there's no buffer when we get
	EOF.
	* cpplib.c (do_define, skip_if_group):
	No need to disable line commands.
	(_cpp_output_line_command): Delete function.
	(do_line): Don't emit line commands here, but set things up so
	they will be emitted if necessary.  Use _cpp_fake_ihash to
	make unique nominal_fnames if necessary.
	(do_elif, do_else, _cpp_handle_eof): Call cpp_error_with_line
	with 0 for column, not -1.
	(_cpp_handle_eof): Don't set the control macro here.  Don't
	clear input_stack_listing_current here.  Don't emit line
	commands.

From-SVN: r33159
2000-04-14 23:29:45 +00:00
Zack Weinberg 3a2b2c7a20 cppexp.c, [...]: Replace cpp_token with cpp_ttype everywhere.
* cppexp.c, cpphash.c, cpphash.h, cpplex.c, cpplib.c,
	cpplib.h, cppmain.c, fix-header.c, scan-decls.c: Replace
	cpp_token with cpp_ttype everywhere.
	* cpperror.c, cpphash.c, cpplex.c, cpplib.c, scan-decls.c:
	Replace cpp_buf_line_and_col with CPP_BUF_LINE and/or
	CPP_BUF_COL.  Line and column numbers are unsigned int, not
	long.
	* cpplex.c (cpp_buf_line_and_col): Delete.
	* cpplib.h (struct cpp_buffer, struct cpp_reader): Change
	'long lineno' to 'unsigned int lineno'.
	(CPP_BUF_LINE, CPP_BUF_COL): New macros.

From-SVN: r33076
2000-04-11 08:29:34 +00:00
Zack Weinberg ae79697b72 cpplib.h: Merge struct cpp_options into struct cpp_reader.
* cpplib.h: Merge struct cpp_options into struct cpp_reader.
	Reorder struct cpp_options and struct cpp_reader for better
	packing.  Replace CPP_OPTIONS macro with CPP_OPTION which
	takes two args.  Change all 'char' flags to 'unsigned char'.
	Move show_column flag into struct cpp_options.  Don't
	prototype cpp_options_init.
	* cpphash.h, cpperror.c, cppexp.c, cppfiles.c, cpphash.c,
	cppinit.c, cpplex.c, cpplib.c:
	Replace CPP_OPTIONS (pfile)->whatever with
	CPP_OPTION (pfile, whatever), and likewise for
	opts = CPP_OPTIONS (pfile); ... opts->whatever;

	* cppinit.c (merge_include_chains): Take a cpp_reader *.
	Extract CPP_OPTION (pfile, pending) and work with that
	directly.
	(cpp_options_init): Delete.
	(cpp_reader_init): Turn on on-by-default options here.
	Allocate the pending structure here.
	(cl_options, enum opt_code): Define these from the same table,
	kept in a large macro.  Add -fshow-column and -fno-show-column
	options.

	* cpperror.c (v_message): If show_column is off, don't print
	the column number.

	* cppmain.c: Update for new interface.
	* fix-header.c: Likewise.

From-SVN: r32850
2000-03-31 23:16:11 +00:00
Zack Weinberg 88ae23e71d Makefile.in (LIBCPP_DEPS): New macro.
* Makefile.in (LIBCPP_DEPS): New macro.
	(cpplib.o, cpphash.o, cpperror.o, cppexp.o, cppfiles.o): Use
	it to declare deps.
	* cpperror.c: Include cpphash.h.
	* cppexp.c: Include cpphash.h.  Remove MULTIBYTE_CHARS
	dingleberry.
	(lex): Don't use CPP_WARN_UNDEF.
	(_cpp_parse_expr): Return an int, the truth value.
	* cppfiles.c: Include cpphash.h.
	(_cpp_merge_include_chains): Move to cppinit.c and make static.
	* cppinit.c (include_defaults_array): Disentangle.
	(cpp_cleanup): Don't free the if stack here.
	(cpp_finish): Pop off all buffers, not just one.
	* cpplib.c (eval_if_expr): Return int.
	(do_xifdef): Rename do_ifdef.
	(handle_directive): Don't use CPP_PREPROCESSED.
	(cpp_get_token): Don't use CPP_C89.
	* fix-header.c: Don't use CPP_OPTIONS.

	* cpplib.h: Move U_CHAR, enum node_type, struct
	file_name_list, struct ihash, is_idchar, is_idstart,
	is_numchar, is_numstart, is_hspace, is_space, CPP_BUF_PEEK,
	CPP_BUF_GET, CPP_FORWARD, CPP_PUTS, CPP_PUTS_Q, CPP_PUTC,
	CPP_PUTC_Q, CPP_NUL_TERMINATE, CPP_NUL_TERMINATE_Q,
	CPP_BUMP_BUFFER_LINE, CPP_BUMP_LINE, CPP_PREV_BUFFER,
	CPP_PRINT_DEPS, CPP_TRADITIONAL, CPP_PEDANTIC, and prototypes
	of _cpp_simplify_pathname, _cpp_find_include_file,
	_cpp_read_include_file, and _cpp_parse_expr to cpphash.h.
	Move struct if_stack to cpplib.c.  Move struct cpp_pending to
	cppinit.c.
	Change all uses of U_CHAR to be unsigned char instead.
	Delete CPP_WARN_UNDEF, CPP_C89, and CPP_PREPROCESSED.

From-SVN: r32435
2000-03-08 23:35:19 +00:00
Kaveh R. Ghazi ad3ffa443a fix-header.c (recognized_function): Also fix prototypes for functions taking "void".
* fix-header.c (recognized_function): Also fix prototypes for
	functions taking "void".

From-SVN: r32206
2000-02-27 02:25:05 +00:00
Jeff Law 3b708058ed Fix copyrights.
From-SVN: r32175
2000-02-25 23:23:30 -07:00
Zack Weinberg cf4ed945ea cppexp.c: Don't include cpphash.h.
* cppexp.c: Don't include cpphash.h.
	(parse_charconst, cpp_lex): Use cpp_defined.
	(cpp_lex): Use get_directive_token throughout.  Remove
	unnecessary cases from switch.  Move assertion-handling code
	down to OTHER case.
	(cpp_parse_expr): If we see '+' or '-', check the context to
	determine if they are unary or binary operators.  Streamline
	the jumps a bit.  Do not call skip_rest_of_line.

	* cpplib.c: Make skip_rest_of_line and cpp_skip_hspace
	static.  Export get_directive_token.  Update commentary.
	(cpp_defined): New function.
	(do_define): Remove reference to T_PCSTRING.  Call
	free_definition to release memory for old definition, when
	redefining a macro.
	(eval_if_expression): Set only_seen_white to 0 before calling
	cpp_parse_expr.  Call skip_rest_of_line after it returns.
	(cpp_read_check_assertion): Don't preserve a pointer into the
	token buffer across a call to cpp_get_token.

	* Makefile.in (cppexp.o): Don't depend on cpphash.h.
	* cppfiles.c (redundant_include_p): Use cpp_defined.
	* cpphash.c (free_definition): New function.
	(delete_macro): Use it.  Update commentary.
	* cpphash.h: Typedef HASHNODE here.  Prototype cpp_lookup and
	free_definition.
	* cpplib.h: Don't typedef HASHNODE here. Delete T_PCSTRING
	from enum node_type.  Prototype cpp_defined and get_directive_token.
	Don't prototype cpp_lookup, skip_rest_of_line, or cpp_skip_hspace.

	* fix-header.c (check_macro_names): Use cpp_defined.
	(read_scan_file): Set inhibit_warnings and inhibit_errors in
	the options structure.

From-SVN: r31908
2000-02-10 23:47:04 +00:00
Zack Weinberg bb52fa7f86 cpplib.h: Provide HASHNODE typedef and forward decl of struct hashnode only.
* cpplib.h: Provide HASHNODE typedef and forward decl of
	struct hashnode only.  Kill cpp_hashnode typedef.  MACRODEF,
	DEFINITION, struct hashnode, struct macrodef, struct
	definition, scan_decls prototype, default defn of
	INCLUDE_LEN_FUDGE moved elsewhere.

	* cpphash.h: MACRODEF, DEFINITION, struct macrodef, struct
	definition, and struct hashnode moved here. Remove the unused
	'predefined' field from struct definition.  Replace the 'args'
	union with its sole member.  All users updated (cpphash.c).
	Delete HASHSTEP and MAKE_POS macros, and hashf prototype.  Add
	multiple include guard.

	* cpphash.c (hashf): Make static; use better algorithm; drop
	HASHSIZE parameter; return an unsigned int.
	(cpp_lookup): Drop HASH parameter.  PFILE parameter is
	used. Calculate HASHSIZE modulus here.
	(cpp_install): Drop HASH parameter. Calculate HASHSIZE modulus
	here.
	(create_definition): Drop PREDEFINITION parameter.
	* cpplib.c (do_define): Don't calculate a hash value here.
	Don't pass (keyword == NULL) to create_definition.

	* scan.h: Prototype scan_decls here.
	* cppfiles.c: Move INCLUDE_LEN_FUDGE default defn here.
	* cppexp.c, cppfiles.c, cppinit.c, cpplib.c, fix-header.c: All
	callers of cpp_lookup and cpp_install updated.

From-SVN: r31881
2000-02-10 02:23:08 +00:00
Zack Weinberg 5fa7f88c06 Makefile.in (GEN_PROTOS_OBJS): Remove libcpp.a.
* Makefile.in (GEN_PROTOS_OBJS): Remove libcpp.a.
	(gen_protos.o): Don't depend on cpplib.h or cpphash.h.
	(fix-header.o): Don't depend on cpphash.h.

	* scan.c (hashstr): New function.
	* scan.h: Prototype it.
	* fix-header.c: Don't include cpphash.h.  Use hashstr.
	* gen-protos.c: Don't include cpphash.h or cpplib.h.  Use
	hashstr.  Report hash table statistics.  Add private
	definition of xrealloc.

From-SVN: r31854
2000-02-08 21:27:02 +00:00
Kaveh R. Ghazi 711d877c9e eh-common.h: PROTO -> PARAMS.
* eh-common.h: PROTO -> PARAMS.
	* emit-rtl.c: Likewise.
	* errors.c: Likewise.
	* errors.h: Likewise.
	* except.c: Likewise.
	* except.h: Likewise.
	* explow.c: Likewise.
	* expmed.c: Likewise.
	* expr.c: Likewise.
	* expr.h: Likewise.
	* final.c: Likewise.
	* fix-header.c: Likewise.
	* flow.c: Likewise.
	* fold-const.c: Likewise.
	* function.c: Likewise.
	* function.h: Likewise.
	* gcc.c: Likewise.
	* gcov-io.h: Likewise.
	* gcov.c: Likewise.
	* gcse.c: Likewise.

From-SVN: r31419
2000-01-14 17:14:43 +00:00
Kaveh R. Ghazi 4b66e1c091 fix-header.c (recognized_extern, [...]): Constify a char*.
* fix-header.c (recognized_extern, recognized_function): Constify
        a char*.

        * lcm.c (compute_laterin): Remove unused variable `temp_bitmap'.
        (pre_edge_lcm): Mark parameter `file' with ATTRIBUTE_UNUSED.
        (compute_available): Remove unused variable `last'.
        (compute_nearerout): Remove unused variable `temp_bitmap'.
        (pre_edge_rev_lcm): Mark parameter `file' with ATTRIBUTE_UNUSED.
        Remove unused variable `x'.

        * scan.h (recognized_function, recognized_extern): Constify a
        char*.

        * simplify-rtx.c (simplify_rtx): Remove unused variable `new'.

From-SVN: r30380
1999-11-03 20:40:32 +00:00
Kaveh R. Ghazi bcc5cac9a7 cpperror.c (cpp_file_line_for_message): Constify a char*.
* cpperror.c (cpp_file_line_for_message): Constify a char*.

	* cppexp.c (parse_number, parse_charconst, cpp_lex,
	cpp_parse_expr): Add static prototypes.
	(parse_charconst): Don't cast away const-ness.
	(token): Constify a char*.

	* cppfiles.c (file_name_list, include_hash, find_include_file,
	finclude, initialize_input_buffer): Constify a char*.
	(file_cleanup, find_position): Add static prototypes.

	* cpphash.c (macro_cleanup, macarg, timestamp, special_symbol,
	collect_expansion): Add static prototypes.
	(cpp_install, create_definition, monthnames): Constify a char*.

	* cpphash.h (cpp_install): Likewise.

	* cppinit.c (known_suffixes, default_include,
	dump_special_to_buffer, NAME, cpp_start_read, cpp_finish): Likewise.
	(base_name, dump_special_to_buffer, initialize_dependency_output):
	Add static prototypes.

	* cpplib.c (my_strerror): Constify a char*.
	(null_underflow, null_cleanup, skip_comment, copy_comment,
	copy_rest_of_line, handle_directive, pass_thru_directive,
	get_directive_token, read_line_number, cpp_print_file_and_line,
	v_cpp_error, v_cpp_warning, v_cpp_error_with_line,
	v_cpp_warning_with_line, detect_if_not_defined,
	consider_directive_while_skipping): Add static prototypes.
	(pass_thru_directive, check_macro_name, cpp_expand_to_buffer,
	cpp_pedwarn_with_file_and_line): Constify a char*.

	* cpplib.h (cpp_options, include_hash, progname, definition,
	cpp_pedwarn_with_file_and_line, cpp_expand_to_buffer,
	check_macro_name, cpp_pfatal_with_name, cpp_file_line_for_message,
	find_include_file, deps_output, include_hash): Constify a char*.

	* cppmain.c (progname): Constify.
	(main): Add prototype.  Use return, not exit.

	* fix-header.c (fatal, add_symbols, lookup_std_proto, write_lbrac,
	recognized_macro, check_macro_names, read_scan_file, write_rbrac,
	inf_skip_spaces, inf_read_upto, inf_scan_ident, inf_scan_ident,
	check_protection): Add static prototype.
	(xfree): Remove.
	(progname, recognized_macrom, recognized_extern): Constify a char*.
	(main): Add prototype.

	* gen-protos.c (progname): Constify a char*.

From-SVN: r29171
1999-09-07 15:41:26 +00:00
Scott Weikart ceb45eb897 * fix-header.c (main): Do not pass a null pointer to strcmp.
From-SVN: r28960
1999-08-29 03:28:09 -06:00
Jeffrey A Law 93b9cce7ad fix-header.c (main): When testing for CONTINUED, use string equality, not pointer equality.
* fix-header.c (main): When testing for CONTINUED, use string
        equality, not pointer equality.

From-SVN: r28396
1999-08-02 01:37:40 -06:00
Zack Weinberg b323effe6d gen-protos.c: #undef abort after including system.h.
1999-04-21 14:55 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
	* gen-protos.c: #undef abort after including system.h.
	Delete defns of fancy_abort and	fatal.
	* fix-header.c: Delete defn of fancy_abort.

From-SVN: r26576
1999-04-21 11:58:11 +00:00
Jeffrey A Law ab87f8c8d1 Merge in gcc2 snapshot 19980929. See gcc/ChangeLog and gcc/FSFChangeLog for
details.

From-SVN: r24879
1999-01-26 18:43:17 -07:00
Kaveh Ghazi f573e6fc7f Update copyrights
From-SVN: r24836
1999-01-23 21:24:02 +00:00
Kaveh R. Ghazi 9b3142b340 final.c (bb_str): Qualify a char* with the keyword `const'.
* final.c (bb_str): Qualify a char* with the keyword `const'.
        (add_bb_string, final_scan_insn, output_asm_insn): Likewise.
        * fix-header.c (read_scan_file): Likewise.
        * genoutput.c (output_epilogue, process_template): Likewise.
        * local-alloc.c (requires_inout, block_alloc): Likewise.
        * output.h (output_asm_insn, assemble_string): Likewise.
        * recog.c (recog_constraints, check_asm_operands,
        decode_asm_operands, extract_insn, preprocess_constraints,
        constrain_operands): Likewise.
        * recog.h (operand_alternative, recog_constraints, insn_template,
        insn_outfun, insn_operand_constraint, insn_name): Likewise.
        * regclass.c (record_reg_classes, scan_one_insn): Likewise.
        * regmove.c (find_matches): Likewise.
        * reload.c (alternative_allows_memconst): Likewise.
        * reload1.c (constraint_accepts_reg_p,
        reload_cse_simplify_operands): Likewise.
        * rtl.h (decode_asm_operands): Likewise.
        * scan.h (fn_decl): Likewise.
        * varasm.c (assemble_string): Likewise.

From-SVN: r24834
1999-01-23 19:45:50 +00:00
Zack Weinberg 2d234b4f64 * fix-header.c: Don't define xstrdup here.
From-SVN: r24337
1998-12-15 15:50:27 -07:00
Zack Weinberg c50bca0894 cpplib.c (initialize_char_syntax): Use ISALPHA and ISALNUM so it'll work on non-ASCII platforms.
1998-12-07  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cpplib.c (initialize_char_syntax): Use ISALPHA and ISALNUM
          so it'll work on non-ASCII platforms.  Always consider $ an
          identifier character.  Take no arguments.
	  (cpp_reader_init): Call initialize_char_syntax with no
          arguments.
	  (cpp_start_read): Don't call initialize_char_syntax again.
          Clear is_idchar['$'] and is_idstart['$'] if not
          opts->dollars_in_ident.
	* cpplib.h (struct cpp_reader): Replace void *data element by
          cpp_options *opts.  Rearrange elements to make gdb printout
          less annoying (put buffer stack at end).
	  (CPP_OPTIONS): Get rid of now-unnecessary cast.
	* cppmain.c: s/data/opts/ when initializing cpp_reader
          structure.
	* c-decl.c: Likewise.
	* objc/objc-act.c: Likewise.
	* fix-header.c: Likewise.

From-SVN: r24154
1998-12-07 09:15:29 -05:00
Kaveh R. Ghazi 2778b98d90 system.h: Include libiberty.h.
* system.h: Include libiberty.h.
        * c-aux-info.c: Remove prototypes for concat/concat3.  Change
        function `concat' from fixed parameters to variable parameters,
        as is done in libiberty.  All callers of concat/concat3
        changed to use the new `concat' with variable args.
        * cccp.c: Remove things made redundant by libiberty.h and/or
        conform to libiberty standards.
        * cexp.y: Likewise.
        * collect2.c: Likewise.
        * config/1750a/1750a.h: Likewise.
        * cppalloc.c: Likewise.
        * cppexp.c: Likewise.
        * cppfiles.c: Likewise.
        * cpphash.c: Likewise.
        * cpplib.c: Likewise.
        * dyn-string.c: Likewise.
        * fix-header.c: Likewise.
        * gcc.c: Likewise.
        * gcov.c: Likewise.
        * genattr.c: Likewise.
        * genattrtab.c: Likewise.
        * gencheck.c: Likewise.
        * gencodes.c: Likewise.
        * genconfig.c: Likewise.
        * genemit.c: Likewise.
        * genextract.c: Likewise.
        * genflags.c: Likewise.
        * gengenrtl.c: Likewise.
        * genopinit.c: Likewise.
        * genoutput.c: Likewise.
        * genpeep.c: Likewise.
        * genrecog.c: Likewise.
        * getpwd.c: Likewise.
        * halfpic.c: Likewise.
        * hash.c: Likewise.
        * mips-tdump.c: Likewise.  Wrap malloc/realloc/calloc prototypes
        in NEED_DECLARATION_* macros.
        * mips-tfile.c: Remove things made redundant by libiberty.h and/or
        conform to libiberty standards.
        (fatal): Fix const-ification of variable `format' in
        !ANSI_PROTOTYPES case.
        * prefix.c: Remove things made redundant by libiberty.h and/or
        conform to libiberty standards.
        * print-rtl.c: Rename variable `spaces' to `xspaces' to avoid
        conflicting with function `spaces' from libiberty.
        * profile.c: Remove things made redundant by libiberty.h and/or
        conform to libiberty standards.
        * protoize.c: Likewise.
        * rtl.h: Likewise.
        * scan.h: Likewise.
        * tlink.c: Likewise.
        * toplev.c: Likewise.
        * toplev.h: Likewise.
        * tree.h: Likewise.

From-SVN: r23931
1998-11-27 10:09:17 +00:00
Kaveh R. Ghazi 5148a72b33 gansidecl.h: Prepend a "G" to the macro wrapping this file (to distinguish it from the macro...
* gansidecl.h: Prepend a "G" to the macro wrapping this file
        (to distinguish it from the macro wrapping ansidecl.h.)
        Include libiberty's ansidecl.h.  Remove all redundant definitions.
        Define the PROTO() style macros in terms of the PARAMS() ones.
        * calls.c (emit_library_call): Switch on ANSI_PROTOTYPES, not
        __STDC__, when deciding whether to use ANSI variable args.
        (emit_library_call_value): Likewise.
        * cccp.c (error): Likewise.
        (warning): Likewise.
        (error_with_line): Likewise.
        (warning_with_line): Likewise.
        (pedwarn): Likewise.
        (pedwarn_with_line): Likewise.
        (pedwarn_with_file_and_line): Likewise.
        (fatal): Likewise.
        * cexp.y (error): Likewise.
        (pedwarn): Likewise.
        (warning): Likewise.
        * collect2.c (fatal_perror): Likewise.
        (fatal): Likewise.
        (error): Likewise.
        * combine.c (gen_rtx_combine): Likewise.
        * cpperror.c (cpp_message): Likewise.
        (cpp_fatal): Likewise.
        * cpplib.c (cpp_error): Likewise.
        (cpp_warning): Likewise.
        (cpp_pedwarn): Likewise.
        (cpp_error_with_line): Likewise.
        (cpp_warning_with_line): Likewise.
        (cpp_pedwarn_with_line): Likewise.
        (cpp_pedwarn_with_file_and_line): Likewise.
        * cpplib.h: Don't define PARAMS() macro.
        * demangle.h: Likewise.
        * doprint.c (checkit): Switch on ANSI_PROTOTYPES, not __STDC__,
        when deciding whether to use ANSI variable args.
        * emit-rtl.c (gen_rtx): Likewise.
        (gen_rtvec): Likewise.
        * final.c (asm_fprintf): Likewise.
        * fix-header.c (cpp_message): Likewise.
        (fatal): Likewise.
        (cpp_fatal): Likewise.
        * gcc.c (concat): Likewise.
        (fatal): Likewise.
        (error): Likewise.
        * genattr.c (fatal): Likewise.
        * genattrtab.c (attr_rtx): Likewise.
        (attr_printf): Likewise.
        (fatal): Likewise.
        * gencodes.c (fatal): Likewise.
        * genconfig.c (fatal): Likewise.
        * genemit.c (fatal): Likewise.
        * genextract.c (fatal): Likewise.
        * genflags.c (fatal): Likewise.
        * genopinit.c (fatal): Likewise.
        * genoutput.c (fatal): Likewise.
        (error): Likewise.
        * genpeep.c (fatal): Likewise.
        * genrecog.c (fatal): Likewise.
        * halfpic.h: Switch on ANSI_PROTOTYPES, not __STDC__, when
        deciding whether to declare `tree_node' and `rtx_def'.
        * hash.h: Don't define stuff we get from gansidecl.h.
        * mips-tfile.c: Likewise.  Define __proto() in terms of PARAMS().
        (fatal): Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
        whether to use ANSI variable args.
        (error): Likewise.
        * prefix.c (concat): Likewise.
        * scan.h: Likewise.
        * system.h: Likewise.
        * toplev.c (error_with_file_and_line): Likewise.
        (error_with_decl): Likewise.
        (error_for_asm): Likewise.
        (error): Likewise.
        (fatal): Likewise.
        (warning_with_file_and_line): Likewise.
        (warning_with_decl): Likewise.
        (warning_for_asm): Likewise.
        (warning): Likewise.
        (pedwarn): Likewise.
        (pedwarn_with_decl): Likewise.
        (pedwarn_with_file_and_line): Likewise.
        (sorry): Likewise.
        (really_sorry): Likewise.
        * toplev.h: Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
        whether to declare `tree_node' and `rtx_def'.
        * tree.c (build): Switch on ANSI_PROTOTYPES, not __STDC__, when
        deciding whether to use ANSI variable args.
        (build_nt): Likewise.
        (build_parse_node): Likewise.

From-SVN: r23577
1998-11-08 15:10:24 +00:00
Kaveh R. Ghazi 0056a9b5cf configure.in (host_xm_file, [...]): Arrange to include gansidecl.h in {ht}config.h & tm.h just before the config/...
* configure.in (host_xm_file, build_xm_file, xm_file, tm_file):
        Arrange to include gansidecl.h in {ht}config.h & tm.h just
        before the config/ directory headers.
        (tm_file_list, host_xm_file_list, build_xm_file_list): Handle
        gansidecl.h in the list of dependencies.
        * Makefile.in (RTL_BASE_H): Don't depend on gansidecl.h.
        (TREE_H, DEMANGLE_H, RECOG_H, REGS_H, libgcc2.a, stmp-multilib,
        mbchar.o, collect2.o, pexecute.o, vfprintf.o, splay-tree.o, gcc.o,
        gencheck.o, choose-temp.o, mkstemp.o, mkstemp.o, prefix.o,
        dyn-string.o, cexp.o, cccp.o, cppmain.o, cpplib.o, cpperror.o,
        cppexp.o, cppfiles.o, cpphash.o, cppalloc.o, scan-decls.o):
        Likewise.
        * cccp.c: Don't include gansidecl.h.
        * cexp.y: Likewise.
        * collect2.c: Likewise.
        * config/c4x/c4x.c: Likewise.
        * config/v850/v850.h: Likewise.
        * cppalloc.c: Likewise.
        * cpperror.c: Likewise.
        * cppexp.c: Likewise.
        * cppfiles.c: Likewise.
        * cpphash.c: Likewise.
        * cpplib.c: Likewise.
        * cppmain.c: Likewise.
        * cppulp.c: Likewise.
        * demangle.h: Likewise.
        * doprint.c: Likewise.
        * dyn-string.c: Likewise.
        * eh-common.h: Likewise.
        * fix-header.c: Likewise.
        * frame.c: Likewise.
        * gcc.c: Likewise.
        * gcov.c: Likewise.
        * gen-protos.c: Likewise.
        * gencheck.c: Likewise.
        * halfpic.h: Likewise.
        * hash.c: Likewise.
        * machmode.h: Likewise.
        * mbchar.c: Likewise.
        * prefix.c: Likewise.
        * protoize.c: Likewise.
        * recog.h: Likewise.
        * rtl.h: Likewise.
        * scan-decls.c: Likewise.
        * tree.h: Likewise.
        * varray.h: Likewise.

From-SVN: r23558
1998-11-07 13:00:46 +00:00
Kaveh R. Ghazi 79c9824ecb Warning fixes:
* Makefile.in (flow.o): Depend on recog.h.
        * cpplib.h (directive_table): Add missing initializiers.
        (finclude): Change type of variable `bsize' to size_t.
        * cse.c (rtx_cost): Mark parameter `outer_code' with ATTRIBUTE_UNUSED.
        * dwarfout.h (dwarfout_label): Wrap prototype in macro RTX_CODE.
        * fix-header.c (lookup_std_proto): Cast the result of `strlen' to
        `int' when comparing against one.
        (cpp_file_line_for_message): Mark parameter `pfile' with
        ATTRIBUTE_UNUSED.
        (cpp_fatal): Mark parameter `pfile' with ATTRIBUTE_UNUSED.
        * flow.c: Include recog.h.
        (sbitmap_copy): Cast arguments 1 & 2 of `bcopy' to (PTR).
        * function.c (thread_prologue_and_epilogue_insns): Mark parameter
        `f' with ATTRIBUTE_UNUSED.
        (reposition_prologue_and_epilogue_notes): Likewise.
        * genopinit.c (gen_insn): Cast argument of ctype functions to
        `unsigned char'.
        * haifa-sched.c: Include recog.h.
        (blockage_range): Cast result of UNIT_BLOCKED macro to (int) when
        comparing against one.
        * libgcc2.a (__throw): Revert ATTRIBUTE_UNUSED change for now.
        * mips-tfile.c (parse_end): Cast the argument of ctype function to
        `unsigned char'.
        (parse_ent): Likewise.
        (parse_input): Likewise.
        * optabs.c (init_libfuncs): Likewise.
        * protoize.c (find_rightmost_formals_list): Likewise.
        * recog.h (const_double_operand): Fix typo in prototype.
        * tlink.c (scan_linker_output): Cast the argument of ctype
        function to `unsigned char'.
        * toplev.c (check_lang_option): Cast the result of `strlen' to
        `int' when comparing against one.

From-SVN: r23155
1998-10-17 20:26:29 +00:00
Kaveh R. Ghazi bf94d1ecc7 Add ATTRIBUTE_NORETURN in a bunch of places:
* cppalloc.c (memory_full): Mark function prototype with
	ATTRIBUTE_NORETURN.
	* demangle.h (collect_exit): Likewise.
	* fix-header.c (v_fatal, fatal): Likewise.
	* gcc.c (pfatal_with_name, pfatal_pexecute, fatal, fancy_abort):
	Likewise.
	* gcov.c (print_usage): Likewise.
	* genattr.c (fatal, fancy_abort): Likewise.
	* genattrtab.c (fatal, fancy_abort): Likewise.
	* gencodes.c (fatal, fancy_abort): Likewise.
	* genconfig.c (fatal, fancy_abort): Likewise.
	* genemit.c (fatal, fancy_abort): Likewise.
	* genextract.c (fatal, fancy_abort): Likewise.
	* genflags.c (fatal, fancy_abort): Likewise.
	* genopinit.c (fatal, fancy_abort): Likewise.
	* genoutput.c (fatal, fancy_abort): Likewise.
	* genpeep.c (fatal, fancy_abort): Likewise.
	* genrecog.c (fatal, fancy_abort): Likewise.
	* libgcc2.c (__eprintf, __default_terminate, __sjthrow,
	__sjpopnthrow, __throw): Likewise.
	* objc/objc-act.c (objc_fatal): Likewise.
	* protoize.c (usage, aux_info_corrupted,
	declare_source_confusing): Likewise.
	* rtl.c (dump_and_abort): Likewise.
	* rtl.h (sets_cc0_p): Likewise.
	* toplev.c (float_signal, pipe_closed): Likewise.

From-SVN: r23084
1998-10-14 10:37:09 +00:00
Jeffrey A Law 8a2cf1b423 * fix-header.c (symlink): Treat like readlink.
From-SVN: r22185
1998-09-02 07:18:27 -06:00
Kaveh R. Ghazi 789f983ab1 system.h: Include stdarg.h/varargs.h...
* system.h: Include stdarg.h/varargs.h, make sure they are ordered
        correctly with regards to stdio.h.
        * calls.c: Remove stdarg.h/varargs.h.
        * cccp.c: Likewise.
        * cexp.y: Likewise.
        * combine.c: Likewise.
        * cpperror.c: Likewise.
        * cpplib.c: Likewise.
        * cpplib.h: Likewise.
        * doprint.c: Likewise.
        * emit-rtl.c: Likewise.
        * final.c: Likewise.
        * fix-header.c: Likewise.
        * gcc.c: Likewise.
        * genattr.c: Likewise.
        * genattrtab.c: Likewise.
        * gencodes.c: Likewise.
        * genconfig.c: Likewise.
        * genemit.c: Likewise.
        * genextract.c: Likewise.
        * genflags.c: Likewise.
        * genopinit.c: Likewise.
        * genoutput.c: Likewise.
        * genpeep.c: Likewise.
        * genrecog.c: Likewise.
        * mips-tfile.c: Likewise.
        * prefix.c: Likewise.
        * protoize.c: Likewise.
        * regmove.c: Likewise.
        * toplev.c: Likewise.
        * tree.c: Likewise.
        * cp/errfn.c: Remove stdarg.h/varargs.h.
        * cp/tree.c: Likewise.

From-SVN: r21997
1998-08-26 08:11:47 +00:00
Kaveh R. Ghazi 487a6e06ce Warning Fixes:
* Makefile.in (print-rtl.o): Depend on bitmap.h.
        (dbxout.o): Depend on toplev.h.
        ($(SCHED_PREFIX)sched.o): Likewise.
        ($(out_object_file)): Likewise for system.h and toplev.h.
        (cppmain.o): Depend on gansidecl.h.
        (cpplib.o): Likewise.
        (cpperror.o): Likewise.
        (cppexp.o): Likewise.
        (cpphash.o): Likewise.
        (cppalloc.o): Likewise.
        (fix-header.o): Depend on cpplib.h and cpphash.h.
        (scan-decls.o): Depend on gansidecl.h.
        * basic-block.h (free_regset_vector): Add prototype.
        * cccp.c (check_precompiled): Mark parameter `fname' with
        ATTRIBUTE_UNUSED.
        (do_assert): Likewise for `op' and `keyword'.
        (do_unassert): Likewise.
        (do_line): Likewise for `keyword'.
        (do_error): Likewise for `op' and `keyword'.
        (do_warning): Likewise.
        (do_ident): Likewise for `keyword'.
        (do_pragma): Likewise for `limit', `op' and `keyword'.
        (do_sccs): Likewise.
        (do_if): Likewise for `keyword'.
        (do_elif): Likewise.
        (do_else): Likewise.
        (do_endif): Likewise.
        * collect2.c (getenv): Remove redundant prototype.
        (collect_exit, collect_execute, dump_file): Likewise.
        (dump_list): Wrap prototype and definition in COLLECT_EXPORT_LIST.
        (dump_prefix_list): Hide prototype and definition.
        * sparc.c: Include toplev.h.
        (intreg_operand): Mark parameter `mode' with ATTRIBUTE_UNUSED.
        (symbolic_memory_operand): Likewise.
        (sp64_medium_pic_operand): Likewise.
        (data_segment_operand): Likewise.
        (text_segment_operand): Likewise.
        (splittable_symbolic_memory_operand): Likewise.
        (splittable_immediate_memory_operand): Likewise.
        (eq_or_neq): Likewise.
        (normal_comp_operator): Likewise.
        (noov_compare_op): Likewise.
        (v9_regcmp_op): Likewise.
        (v8plus_regcmp_op): Likewise.
        (extend_op): Likewise.
        (cc_arithop): Likewise.
        (cc_arithopn): Likewise.
        (small_int): Likewise.
        (uns_small_int): Likewise.
        (clobbered_register): Likewise.
        (legitimize_pic_address): Likewise.
        (delay_operand): Likewise.
        (sparc_builtin_saveregs): Remove unused variable `stdarg'.
        * sparc.h (order_regs_for_local_alloc, eligible_for_return_delay,
        sparc_issue_rate, v8plus_regcmp_p): Add prototypes.
        * sparc.md (cmpdi_v8plus): Add abort for default case in switch.
        * cppalloc.c: Include gansidecl.h.
        * cpperror.c: Include stdarg.h/varargs.h and gansidecl.h.
        (cpp_file_line_for_message): Mark parameter `pfile' with
        ATTRIBUTE_UNUSED.
        (v_cpp_message): New function.
        (cpp_message): Use it.  Also convert to variable arguments.
        (cpp_fatal): Likewise.
        (cpp_pfatal_with_name): Constify parameter `name'.
        * cppexp.c: Move gansidecl.h before cpplib.h.
        * cpphash.c: Likewise.
        * cpphash.h (hashf, delete_macro): Add prototypes.
        * cpplib.c: Include stdarg.h/varargs.h and move gansidecl.h before
        cpplib.h.  Don't include errno.h.
        (update_path): Add arguments to prototype.
        (cpp_fatal, cpp_file_line_for_message, cpp_message, delete_macro,
        cpp_print_containing_files): Remove redundant prototypes.
        (cpp_hash_cleanup, add_import, append_include_chain,
        make_assertion, path_include, initialize_builtins,
        initialize_char_syntax, finclude, validate_else, comp_def_part,
        lookup_import, redundant_include_p, is_system_include,
        read_name_map, read_filename_string, open_include_file,
        check_macro_name, compare_defs, compare_token_lists,
        eval_if_expression, change_newlines): Add prototype arguments.
        (hashf): Remove redundant prototype.
        (read_token_list, free_token_list, safe_read, xcalloc, savestring,
        conditional_skip, skip_if_group): Add prototype arguments.
        (fdopen): Remove redundant prototype.
        (do_define, do_line, do_include, do_undef, do_error, do_pragma,
        do_ident, do_if, do_xifdef, do_else, do_elif, do_endif, do_sccs,
        do_once, do_assert, do_unassert, do_warning): Add prototype arguments.
        (struct directive): Add prototype arguments to function pointer
        member `func'.
        (handle_directive): Add missing arguments to call to `do_line'.
        (do_include): Mark parameters `unused1' and `unused2' with
        ATTRIBUTE_UNUSED.
        (do_line): Likewise for `keyword' and new parameters `unused1' and
        `unused2'.
        (do_error): Likewise for `keyword'.
        (do_warning): Likewise.  Also add missing argument `pfile' in call
        to cpp_pedwarn.
        (do_once): Mark parameter `keyword', `unused1' and `unused2' with
        ATTRIBUTE_UNUSED.
        (do_ident): Likewise for `keyword', `buf' and `limit'.
        (do_pragma): Likewise.  Also add missing arguments in call to do_once.
        (do_sccs): Mark parameter `keyword', `buf' and `limit' with
        ATTRIBUTE_UNUSED.
        (do_if): Likewise for `keyword'.
        (do_elif): Likewise.
        (eval_if_expression): Likewise for `buf' and `length'.
        (do_xifdef): Likewise for `unused1' and `unused2'.
        (do_else): Likewise for `keyword', `buf' and `limit'.
        (do_endif): Likewise.
        (parse_name): Add missing argument `pfile' in call to cpp_pedwarn.
        (cpp_handle_options): Remove superfluous NULL argument in call to
        cpp_fatal.
        (cpp_handle_options): Likewise.
        (do_assert): Mark parameter `keyword', `buf' and `limit' with
        ATTRIBUTE_UNUSED.
        (do_unassert): Likewise.
        (cpp_print_file_and_line): Add missing argument `pfile' in call to
        cpp_file_line_for_message.
        (v_cpp_error): New function.
        (cpp_error): Use it. Also accept variable arguments.
        (v_cpp_warning): New function.
        (cpp_warning): Use it. Also accept variable arguments.
        (cpp_pedwarn): Accept variable arguments.
        (v_cpp_error_with_line): New function
        (cpp_error_with_line): Use it.  Accept variable arguments.
        (v_cpp_warning_with_line): New function.
        (cpp_warning_with_line): Use it.  Accept variable arguments.  Hide
        definition.
        (cpp_pedwarn_with_line): Accept variable arguments.
        (cpp_pedwarn_with_file_and_line): Likewise.
        (cpp_error_from_errno): Constify parameter `name'.  Add missing
        argument `pfile' in call to cpp_file_line_for_message.
        (cpp_perror_with_name): Constify parameter `name'.
        * cpplib.h: Define PARAMS() in terms of PROTO().
        (fatal): Remove redundant prototype.
        (cpp_error, cpp_warning, cpp_pedwarn, cpp_error_with_line,
        cpp_pedwarn_with_line, cpp_pedwarn_with_file_and_line,
        cpp_error_from_errno, cpp_perror_with_name, cpp_pfatal_with_name,
        cpp_fatal, cpp_message, cpp_pfatal_with_name,
        cpp_file_line_for_message, cpp_print_containing_files): Add
        arguments to prototypes.
        (scan_decls, cpp_finish): Add prototypes.
        * cppmain.c: Include gansidecl.h.
        (main): Remove unused variable `i'.
        * dbxout.c: Include toplev.h.
        * demangle.h (do_tlink, collect_execute, collect_exit,
        collect_wait, dump_file, file_exists): Add prototype.
        * dwarf2out.c (dwarf_type_encoding_name, decl_start_label): Hide
        prototype and definition.
        (gen_unspecified_parameters_die): Don't assign results of call to
        function new_die() to unused variable `parm_die'.
        (dwarf2out_line): Mark parameter `filename' with ATTRIBUTE_UNUSED.
        (dwarf2out_define): Likewise for `lineno' and `buffer'.
        * dwarfout.c (output_unsigned_leb128, output_signed_leb128): Hide
        prototype and definition.
        (output_die): Add prototype arguments to function pointer arg.
        (output_unspecified_parameters_die): Mark parameter `arg' with
        ATTRIBUTE_UNUSED.
        * except.c (output_exception_table_entry): Remove unused variable
        `eh_entry'.
        * except.h (expand_fixup_region_start, expand_fixup_region_end):
        Add prototypes.
        * expr.c (do_jump_by_parts_equality_rtx): Remove prototype.
        * expr.h (do_jump_by_parts_equality_rtx): Add prototype.
        * fix-header.c: Include stdarg.h/varargs.h, move gansidecl.h
        before cpplib.h, include cpphash.h, remove redundant prototype of
        cpp_fatal, don't define `const', add a prototype for `fatal'.
        (cpp_file_line_for_message): Add missing arguments `pfile'.
        (v_cpp_message): New function.
        (cpp_message): Use it.
        (v_fatal): New function.
        (fatal, cpp_fatal): Use it.
        (cpp_pfatal_with_name): Constify parameter `name'.
        * flow.c (free_regset_vector): Remove redundant prototype.
        * function.c (round_down): Wrap prototype and definition with
        macro ARGS_GROW_DOWNWARD.
        (record_insns): Wrap prototype and definition with
        defined (HAVE_prologue) || defined (HAVE_epilogue).
        * gansidecl.h (ATTRIBUTE_PRINTF_4, ATTRIBUTE_PRINTF_5): New macros.
        * gen-protos.c: Include gansidecl.h.
        (hashf): Don't make it static, constify parameter `name'.
        * genattrtab.c (check_attr_test): Change XEXP() to XSTR() to match
        specifier %s in calls to function `fatal'.
        * haifa-sched.c: Include toplev.h.
        (find_rgns): Remove unused variable `j'.
        * integrate.c (note_modified_parmregs): Mark parameter `x' with
        ATTRIBUTE_UNUSED.
        (mark_stores): Likewise.
        * jump.c (mark_modified_reg): Likewise.
        * output.h (insn_current_reference_address): Add prototype.
        (eh_frame_section): Likewise.
        * print-rtl.c: Include bitmap.h.
        * reload1.c (reload): Wrap variables `note' and `next' in macro
        PRESERVE_DEATH_INFO_REGNO_P.
        (forget_old_reloads_1): Mark parameter `ignored' with
        ATTRIBUTE_UNUSED.
        (choose_reload_regs): Remove unused variable `in'.
        (reload_cse_invalidate_mem): Mark parameter `ignore' with
        ATTRIBUTE_UNUSED.
        (reload_cse_check_clobber): Likewise.
        * rtl.h (expand_null_return, reg_classes_intersect_p): Add prototype.
        (mark_elimination): Fix typo in prototype.
        * scan-decls.c: Include gansidecl.h.
        * tree.h (using_eh_for_cleanups, supports_one_only): Add prototype.

From-SVN: r19867
1998-05-19 08:42:48 +00:00
Kaveh R. Ghazi d6f4ec5199 Warning fixes:
* Makefile.in (c-lang.o): Depend on c-tree.h, c-lex.h and toplev.h.
	(c-lex.o): Depend on output.h.
	(c-common.o): Likewise.
	(stmt.o): Likewise.
	(calls.o): Likewise.
	(integrate.o): Depend on toplev.h.
	(regclass.o): Depend on output.h.
	(final.o): Depend on reload.h.
	* c-common.c: Include output.h.
	(check_format_info): Remove unused variable `integral_format'.
	* c-decl.c (print_lang_decl): Mark parameters `file', `node' and
	`indent' with ATTRIBUTE_UNUSED.
	(print_lang_type): Likewise.
	(maybe_build_cleanup): Likewise for parameter `decl'.
	(copy_lang_decl): Likewise for parameter `node'.
	* c-lang.c: Include c-tree.h, c-lex.h and toplev.h.
	(lang_print_xnode): Mark parameters `file', `node' and `indent'
 	with ATTRIBUTE_UNUSED.
	(lookup_interface): Likewise for parameter `arg'.
	(is_class_name): Likewise.
	(maybe_objc_check_decl): Likewise for parameter `decl'.
	(maybe_objc_comptypes): Likewise for parameters `lhs', `rhs' and
	`reflexive'.
	(maybe_objc_method_name): Likewise for parameter `decl'.
	(build_objc_string): Likewise for parameters `len' and `str'.
	* c-lex.c: Include output.h.
	* c-lex.h (position_after_white_space): Correct typo in prototype.
	* c-tree.h (finish_file, c_expand_start_cond, c_expand_start_else,
 	c_expand_end_cond, init_iterators): Add prototypes.
	* caller-save.c (set_reg_live): Mark parameters `reg' and `setter'
	with ATTRIBUTE_UNUSED.
	* calls.c: Include output.h.
	* cccp.c (pipe_closed): Mark parameter `signo' with
 	ATTRIBUTE_UNUSED.
	* combine.c: Move inclusion of expr.h to after insn-config.h.
	* iris6.h (ASM_IDENTIFY_GCC, ASM_IDENTIFY_LANGUAGE): Don't define
	as empty, rather define as ((void)0).
	* sparc.c (sparc_check_64): Add braces around ambiguous `else'.
	Add parentheses around assignment used as truth value.
	* cplus-dem.c (squangle_mop_up): Change return type to void.
	(internal_cplus_demangle): Remove unused parameter `options'.
	All callers changed.
	(cplus_demangle_opname): Remove function wide variable `int i' and
 	replace with `size_t i' at each location where it is used.
	(cplus_demangle_opname): change type of `i' from int to size_t.
	* cppexp.c (right_shift): Mark parameter `pfile' with
	ATTRIBUTE_UNUSED.
	* cpphash.c (cpp_lookup): Likewise.
	(cpp_hash_cleanup): Likewise.
	* cpplib.c (parse_name): Add a prototype and make it static.
	(null_underflow): Mark parameter `pfile' with ATTRIBUTE_UNUSED.
	(null_cleanup): Likewise for parameters `pbuf' and `pfile'.
	(macro_cleanup): Likewise for parameter `pfile'.
	(file_cleanup): Likewise.
	* cpplib.h (cpp_reader_init, cpp_options_init, cpp_start_read,
 	cpp_read_check_assertion, skip_rest_of_line): Add prototypes.
	* crtstuff.c (force_to_data, __CTOR_LIST__, force_to_data,
	__DTOR_END__, __FRAME_END__): Mark with ATTRIBUTE_UNUSED.
	* cse.c (cse_check_loop_start): Mark parameter `set' with
 	ATTRIBUTE_UNUSED.
	* dbxout.c (flag_minimal_debug, have_used_extensions,
	source_label_number): Move inside macro wrapper check against
	defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO).
	* dwarf2out.c (gen_entry_point_die): Hide prototype and definition.
	* except.h (doing_eh): Provide prototype.
	* expr.c: Move inclusion of expr.h to after insn-config.h.
	* final.c: Include reload.h.
	(shorten_branches): Cast the first argument of bzero to char *.
	* fix-header.c (cpp_print_containing_files): Mark parameter
 	`pfile' with ATTRIBUTE_UNUSED.
	(cpp_fatal): Likewise.
	* flow.c (find_basic_blocks_1): Cast the first argument of bzero
	to char *.
	* genattrtab.c (make_length_attrs): Change the type of variable
	`i' from int to size_t.
	(zero_fn): Mark parameter `exp' with ATTRIBUTE_UNUSED.
	(one_fn): Likewise.
	* genextract.c (main): When generating insn-extract.c, mark
	variable `junk' with ATTRIBUTE_UNUSED.
	* gengenrtl.c (gencode): When generating genrtl.c, cast the first
	argument of bzero to char*.
	* integrate.c: Include toplev.h.
	* libgcc2.c: Wrap `struct exception_table' and
	`find_exception_handler' in macro DWARF2_UNWIND_INFO.
	* objc/Make-lang.in (objc-act.o): Depend on toplev.h.
	* objc/objc-act.c: Include toplev.h.
	(lang_print_xnode): Mark parameters `file', `node' and `indent'
	with ATTRIBUTE_UNUSED.
	(finish_protocol): Likewise for parameter `protocol'.
	* output.h (declare_weak): Add prototype.
	(decode_reg_name): Don't wrap with TREE_CODE macro.
	(assemble_alias): Add prototype.
	* regclass.c: Include output.h.
	* reload.h (reloads_conflict): Add prototype.
	* rtl.h (print_rtl_single, mark_elimiation, reg_class_subset_p,
	output_func_start_profiler): Add prototypes.
	* rtlanal.c (reg_set_p_1): Mark parameters `x' and `pat' with
 	ATTRIBUTE_UNUSED.
	* scan-decls.c: Include scan.h.
	* scan.h (recognized_function, recognized_extern): Add prototypes.
	* stmt.c: Include output.h.
	* toplev.c (error_for_asm, warning_for_asm): Remove prototypes.
	(output_lang_identify): Hide prototype and definition.
	(float_signal): Mark parameter `signo' with ATTRIBUTE_UNUSED.
	(pipe_closed): Likewise.
	* toplev.h (count_error, strip_off_ending, error_for_asm,
 	warning_for_asm): Add prototypes.

From-SVN: r19712
1998-05-13 12:40:39 +00:00
Kaveh R. Ghazi e9a780ecec c-common.c: Convert to using ctype macros defined in system.h.
* c-common.c: Convert to using ctype macros defined in system.h.
        * c-lex.c: Likewise.
        * cccp.c: Likewise.
        * collect2.c: Likewise.
        * rs6000.c: Likewise.
        * cpplib.c: Likewise.
        * fix-header.c: Likewise.
        * gcc.c: Likewise.
        * gen-protos.c: Likewise.
        * pexecute.c: Likewise.
        * protoize.c: Likewise.
        * rtl.c: Likewise.
        * scan.c: Likewise.
        * stmt.c: Likewise.
        * tlink.c: Likewise.
        * toplev.c: Likewise.

From-SVN: r19579
1998-05-06 12:56:58 +00:00
Kaveh R. Ghazi e572c0c68c Be more careful when including <time.h> and <sys/file.h> in system.h.
Consolidate O_RDONLY/O_WRONLY fallback definitions from various files
into system.h.
        * system.h: Wrap time.h and sys/file.h in autoconf checks.
        Provide default definitions for O_RDONLY and O_WRONLY here.
        * cccp.c, cpplib.c, fix-header.c, gcc.c, protoize.c: Not here.

From-SVN: r19571
1998-05-06 07:58:27 +00:00
Manfred Hollstein 25cf40e29d fix-header.c (write_rbrac): Add "abort" to functions which need to be protected.
(
	* fix-header.c (write_rbrac): Add "abort" to functions which need to
	be protected.

From-SVN: r19556
1998-05-05 23:23:41 +00:00
Manfred Hollstein 4f1817ee4f fix-header.c (enum special_file): Undefine enumerators if they are already defined by include files.
d
	* fix-header.c (enum special_file): Undefine enumerators if they
	are already defined by include files.
	* fixproto (rel_source_file in unistd.h stdlib.h): Prefix file protection
	macro with '__' to not pollute user namespace.

From-SVN: r19297
1998-04-19 06:48:07 +00:00
Kaveh R. Ghazi b04cd50711 More cutover to system.h:
* 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-30 12:05:54 +00:00
Jeffrey A Law 72e1947054 cpplib.c (cpp_file_line_for_message): Delete unused parameter.
* 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-29 04:51:23 -07:00
Kaveh R. Ghazi 081f5e7e66 Fix more warnings...
* 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-03-18 07:18:06 +00:00
Jeff Law 9870475ca0 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
1998-01-27 15:11:54 -07:00
Kaveh R. Ghazi 9e04c65a52 cse.c (rtx_cost): Add default case in enumeration switch.
* cse.c (rtx_cost): Add default case in enumeration switch.
        * fix-header.c (recognized_macro): Likewise.
        (recognized_extern): Likewise.
        (write_rbrac): Likewise.
        * objc/objc-act.c (encode_aggregate): Likewise.
        (gen_declarator): Likewise.
        (gen_declspecs): Likewise.

From-SVN: r17186
1997-12-22 02:31:41 -07:00
Mike Stump db3cf6fb33 reformat a little to match GNU coding standards.
From-SVN: r14024
1997-05-06 23:05:54 +00:00
Richard Kenner 2e3f9f3d62 Use symbolic codes for exit.
From-SVN: r13938
1997-04-20 12:39:28 -04:00
Mike Stump 0f41302f47 formatting tweaks
From-SVN: r12390
1996-07-03 22:07:53 +00:00
Per Bothner 35e93fb4de * fix-header.c (read_scan_file): Use CPP_FATAL_ERRORS.
From-SVN: r12210
1996-06-07 00:32:32 -07:00
Per Bothner c57a4b7c02 fix-header.c (read_scan_file): Use cpp_fatal.
* fix-header.c (read_scan_file):  Use cpp_fatal.
Use renamed function names, and return protocols.
* fix-header.c (check_macro_names):  Fix struct parse_file->cpp_reader.

From-SVN: r12204
1996-06-06 20:07:32 -07:00
Doug Evans 0afdf56596 fix-header.c: #include "gansidecl.h".
* fix-header.c: #include "gansidecl.h".
	(const): Delete.

From-SVN: r11793
1996-04-15 17:58:45 +00:00
Per Bothner 5a3f1ec3ea fix-header.c: Add EXIT_FAILURE and EXIT_SUCCESS to stdlib.h i missing.
* fix-header.c:  Add EXIT_FAILURE and EXIT_SUCCESS to stdlib.h i
missing.  Re-write how errno is added to be done similarly
(XOPEN_SYMBOL, XOPEN_EXTENDED_SYMBOL):  New macros, to mark XPG4 functions.
(std_include_table):  Add a number of functions (mostly XPG4).

From-SVN: r10888
1995-12-27 14:28:33 -08:00
Per Bothner 944420629e fix-header.c: Support different kinds of functions (ANSI and Posix1).
* fix-header.c:  Support different kinds of functions (ANSI and
Posix1).  Enable ANSI proptotypes if __STRICT_ANSI__.

From-SVN: r10729
1995-12-14 23:43:33 -08:00
Richard Kenner abc95ed36d Fix spelling errors.
From-SVN: r10289
1995-08-28 06:54:22 -04:00
Richard Kenner 1a10ad657d Update header.
From-SVN: r9960
1995-06-15 07:33:49 -04:00