aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-opts.c
AgeCommit message (Collapse)AuthorFilesLines
2003-05-19c-opts.c (c_common_decode_option): Don't accept dollars as identifier ↵Neil Booth1-0/+1
characters in assembly. * c-opts.c (c_common_decode_option): Don't accept dollars as identifier characters in assembly. * doc/cpp.texi: Document this. From-SVN: r66976
2003-05-19Add a new flag...Matt Austern1-0/+5
Add a new flag, -W(no-)invalid-offsetof, to control whether or not the compiler warns about incorrect use of the offsetof macro in C++. By default the warning is on. From-SVN: r66972
2003-05-17c-common.c, c-common.h (dollars_in_ident): Remove.Neil Booth1-1/+6
* c-common.c, c-common.h (dollars_in_ident): Remove. * c-opts.c (DOLLARS_IN_IDENTIFIERS): Default to true. (c_common_init_options, c_common_decode_option): Set dollars_in_ident. * cpphash.h (warned_dollar): Rename warn_dollars. * cppinit.c (struct lang_flags, lang_defaults, cpp_set_lang) Permit dollars regardless of -std=. (post_options): Set warn_dollars. * cpplex.c (forms_identifier_p): Use warn_dollars. * config/darwin.h, config/alpha/vms.h, config/m68hc11/m68hc11.h: Remove redundant definitions of DOLLARS_IN_IDENTIFIERS. * doc/cpp.texi, doc/cppopts.texi, doc/invoke.texi, doc/tm.texi: Update documentation. testsuite: * gcc.dg/dollar.c: New test. From-SVN: r66911
2003-05-13diagnostic.c (output_format): Add support for %m.Zack Weinberg1-4/+4
* diagnostic.c (output_format): Add support for %m. (output_printf, output_verbatim, diagnostic_set_info, verbatim): Set err_no field of the text_info structure being initialized. (fatal_io_error): Delete function. * diagnostic.h (text_info): Add err_no field. * toplev.h (fatal_io_error): Delete prototype. * c-opts.c, c-pch.c, dwarfout.c, ggc-common.c, ggc-page.c, graph.c * toplev.c, config/mips/mips.c, config/rs6000/host-darwin.c * f/com.c, java/jcf-parse.c, java/jcf-write.c, java/lex.c * objc/objc-act.c: Replace all calls to fatal_io_error with calls to fatal_error; add ": %m" to the end of all the affected error messages. From-SVN: r66769
2003-05-11c-cppbuiltin.c (c_cpp_builtins): Move __STDC_HOSTED__ into cpplib as it's a ↵Neil Booth1-1/+1
Standard Predefined Macro. * c-cppbuiltin.c (c_cpp_builtins): Move __STDC_HOSTED__ into cpplib as it's a Standard Predefined Macro. * c-opts.c (finish_options): Pass flag_hosted to cpp_init_builtins. * cppinit.c (_cpp_init_builtins): Take HOSTED. Define __STDC_HOSTED__ appropriately. * cpplib.h (_cpp_init_builtins): Update. * fix-header.c (read_scan_file): Update. * doc/cpp.texi, doc/cppopts.texi: Update documentation. * cppfiles.c (find_or_create_entry): Preserve errno. From-SVN: r66688
2003-05-11re PR c++/689 ([diagnostic] this warning is not helpful: `class xxxx' only ↵Gabriel Dos Reis1-1/+0
defines a private destructor and has no friend) PR C++/689 PR C++/9257 * c-opts.c (c_common_decode_option): Don't set warn_ctor_dtor_privacy wen -Wall. * c-common.c (warn_ctor_dtor_privacy): Don't turn on by default. From-SVN: r66684
2003-05-06c-opts.c (COMMAND_LINE_OPTIONS): Reject -Wmissing-prototypes and ↵Neil Booth1-2/+2
-Wstrict-prototypes if C++. * c-opts.c (COMMAND_LINE_OPTIONS): Reject -Wmissing-prototypes and -Wstrict-prototypes if C++. From-SVN: r66533
2003-05-03re PR c/10604 (-Wall includes sign conversion warning [3.3 regression])Zack Weinberg1-3/+7
PR c/10604 * c-common.c (warn_sign_compare): Initialize to -1. * c-opts.c (c_common_init_options): Don't set warn_sign_compare here. (c_common_decode_option <OPT_Wall>): Set warn_sign_compare for C++ only. (c_common_post_options): Set warn_sign_compare from extra_warnings if it's still -1 at this point. * toplev.c (maybe_warn_unused_parameter): New static variable. (set_Wextra): New static function. (W_options): Remove "extra". (decode_W_option): Call set_Wextra. (independent_decode_option): Likewise. (set_Wunused): Cooperate with set_Wextra in setting warn_unused_parameter. (rest_of_compilation): No need to check extra_warnings as well as warn_uninitialized. * c-typeck.c (build_binary_op, build_conditional_expr): No need to check extra_warnings as well as warn_sign_compare. (internal_build_compound_expr): No need to check extra_warnings as well as warn_unused_value. * function.c (expand_function_end): No need to check extra_warnings as well as warn_unused_parameter. * stmt.c (expand_expr_stmt_value): No need to check extra_warnings as well as warn_unused_value. * cp/typeck.c (build_x_compound_expr): No need to check extra_warnings as well as warn_unused_value. * doc/invoke.texi: Clarify documentation of -Wsign-compare. * gcc.dg/compare7.c, g++.dg/warn/compare1.C: New testcases. * Makefile.in: Disable -Werror for gengtype-lex.o. From-SVN: r66436
2003-05-01input.h (lineno): Rename to ...Nathan Sidwell1-5/+5
* input.h (lineno): Rename to ... (input_line): ... here. * tree.h (lineno): Rename to ... (input_line): ... here. * scan.h (lineno): Rename to ... (input_line): ... here. * toplev.c (lineno): Rename to ... (input_line): ... here. (push_srcloc, pop_srcloc): Rename lineno to input_line. * c-common.c (c_expand_start_cond, fname_decl): Likewise. * c-decl.c (poplevel, pop_label_level, lookup_label, lookup_tag, store_parm_decls, c_expand_body_1): Likewise. * c-errors.c (pedwarn_c99): Likewise. * c-format.c (status_warning): Likewise. * c-lex.c (fe_file_change, cb_def_pragma, c_lex): Likewise. * c-opts.c (c_common_post_options, c_common_parse_file): Likewise. * c-parse.in (save_filename, maybe_type_qual, ifc): Likwise. * c-semantics.c (finish_stmt_tree, build_stmt, emit_local_var, gentrtl_goto_stmt, genrtl_expr_stmt_value, genrtl_decl_stmt, genrtl_if_stmt, genrtl_while_stmt, genrtl_do_stmt, genrtl_return_stmt, genrtl_for_stmt, build_break_stmt, build_continue_stmt, genrtl_switch_stmt, genrtl_asm_stmt, prep_stmt, find_reachable_label, expand_unreachable_stmt): Likewise. * coverage.c (create_coverage): Likewise. * diagnostic.c (pedwarn, sorry, error, fatal_error, internal_error, warning, diagnostic_report_current_module, inform): Likewise. * expr.c (expand_expr): Likewise. * integrate.c (expand_inline_function, output_inline_function): Likewise. * rtl-error.c (file_and_line_for_asm): Likewise. * tree-inline.c (find_alloca_call, find_builtin_longjmp_call, walk_tree): Likewise. * tree.c (make_node): Likewise. * ada, cp, f, java, objc, treelang: Likewise. ada * trans.c (build_unit_elab, set_lineno): Rename lineno to input_line. * utils.c (pushdecl, create_label_decl, begin_subprog_body, end_subprog_body): Likewise. * utils2.c (build_call_raise): Likewise. cp * class.c (finish_struct): Rename lineno to input_line. * decl.c (push_binding_level, pop_binding_level, suspend_binding_level, resume_binding_level, make_label_decl, use_label, start_function): Likewise. * decl2.c (warn_if_unknown_interface, start_static_initialization_or_destruction, generate_ctor_or_dtor_function, finish_file): Likewise. * error.c (cp_line_of, print_instantiation_full_context, print_instantiation_context): Likewise. * except.c (check_handlers_1, check_handlers): Likewise. * init.c (create_temporary_var): Likewise. * method.c (use_thunk, synthesize_method): Likewise. * parser.c (cp_lexer_set_source_position_from_token, cp_lexer_get_preprocessor_token): Likewise. * pt.c (push_tinst_level, pop_tinst_level, tsubst_friend_function, instantiate_class_template, tsubst_decl, tsubst, tsubst_expr, instantiate_decl): Likewise. * semantics.c (genrtl_try_block, finish_label_stmt, begin_class_definition, expand_body, genrtl_finish_function): Likewise. * tree.c (build_min_nt, build_min): Likewise. f * ansify.c (die_unless): Rename lineno to input_line. * com.c (ffecom_subscript_check_, ffecom_do_entry_, ffecom_gen_sfuncdef_, ffecom_start_progunit_, ffecom_sym_transform_, ffecom_sym_transform_assign_, bison_rule_pushlevel_, bison_rule_compstmt_, finish_function, store_parm_decls): Likewise. * intrin.c (ffeintrin_fulfill_generic): Likewise. * lex.c (ffelex_hash_, ffelex_include_, ffelex_next_line_, ffelex_file_fixed, ffelex_file_free): Likewise. * std.c (ffestd_exec_end): Likewise. * ste.c (ffeste_emit_line_note_, ffeste_start_block_, ffeste_start_stmt_): Likewise. * ste.h (ffeste_filelinenum, ffeste_set_line): Likewise. java * lex.h (lineno): Rename to ... (input_line): ... here * parse-scan.y (lineno): Rename to ... (input_line): ... here. (reset_report): Rename lineno to input_line. * check-init.c (check_init): Likewise. * class.c (push_class): Likewise. * decl.c (complete_start_java_method, end_java_method): Likewise. * expr.c (expand_byte_code): Likewise. * jcf-parse.c (give_name_to_class, parse_class_file): Likewise. * jcf-write.c (generate_bytecode_insns): Likewise. * lex.c (java_init_lex, java_allocate_new_line, do_java_lex): Likewise. * parse.h (YYNOT_TWICE): Likewise. * parse.y (empty_statement, expression_statement, java_pop_parser_context, java_parser_context_save_global, yyerror, register_fields, method_header, safe_layout_class, find_in_imports_on_demand, create_artificial_method, source_end_java_method, start_complete_expand_method, build_thisn_assign, java_complete_lhs, maybe_absorb_scoping_block): Likewise. objc * objc-act.c (objc_init): Rename lineno to input_line. (build_module_descriptor, build_selector_translation_table, build_protocol_template, build_method_prototype_list_template, build_category_template, build_selector_table, build_class_template, build_super_template, build_ivar_template, build_ivar_list_template, build_method_list_template, build_method_template, add_instance_variable): Likewise. treelang * tree1.c (treelang_init): Rename lineno to input_line. From-SVN: r66333
2003-03-20Various cleanups to help compile server.Per Bothner1-5/+6
* cppinit.c (cpp_create_reader): Take extra hash_table* argument, and pass that to _cpp_init_hashtable. (cpp_read_main_file): Drop hash_table* argument; don't call _cpp_init_hashtable. * cpplib.h: Update declarations to match. * c-opts.c (c_common_init_options): Pass ident_hash to cpp_create_reader. (c_common_post_options): Don't pass ident_hash to cpp_read_main_file. * fix-header.c (read_scan_file): Likewise pass NULL table to cpp_create_reader rather than cpp_read_main_file. * cppfiles.c (cpp_rename_file): Generalized and renamed to cpp_change_file. * cpplib.h: Update declaration to match. * c-opts.c (push_command_line_line, finish_options): Change cpp_rename_file calls to cpp_change_file. From-SVN: r64617
2003-03-17c-opts.c: Default TARGET_EBCDIC to 0 if not defined.Neil Booth1-0/+5
* c-opts.c: Default TARGET_EBCDIC to 0 if not defined. (c_common_init): Set EBCDIC in cpp options. * cpplex.c (maybe_read_ucs, cpp_parse_escape): Use EBCDIC option, not conditional compilation. * cpplib.h (struct cpp_options): New entry EBCDIC. From-SVN: r64471
2003-03-15Makefile.in: Update.Neil Booth1-21/+50
* Makefile.in: Update. * c-common.h (cb_register_builtins): Rename c_cpp_builtins. * c-lex.c (init_c_lex): Register builtins hook is dead. * c-opts.c (COMMAND_LINE_OPTIONS, missing_arg): Handle -A, -D and -U. (c_common_decode_option): Don't call cpp_handle_option. Handle -A, -D and -U. (handle_deferred_opts): Simplify. (finish_options): Define builtins and command line macros. * c-ppoutput.c (init_pp_output): Register builtins hook is dead. * cppinit.c: Don't include intl.h. (init_builtins): Rename cpp_init_builtins. No hook to call. (init_library): Don't need to sort options. (cpp_create_reader): Don't set pending. (cpp_destroy): Don't free pending. (struct pending_option, cl_directive_handler, struct cpp_pending, APPEND, free_chain, new_pending_directive, parse_option, opt_comp, cpp_finish_options, COMMAND_LINE_OPTIONS, DEF_OPT, struct cl_option, cl_options, cpp_handle_option): Remove. * cpplib.h (struct cpp_pending, register_builtins, cpp_handle_option, cpp_finish_options): Remove. (cpp_init_builtins): New. * fix-header.c (read_scan_file): Update to handle -D. Fix handling of -I. Replace call to cpp_finish_options. cp: * Make-lang.in: Update. From-SVN: r64398
2003-03-14c-opts.c (finish_options): New.Neil Booth1-4/+32
* c-opts.c (finish_options): New. (COMMAND_LINE_OPTIONS, c_common_decode_option): Add -imacros. (missing_arg): Handle OPT_include and OPT_imacros. (c_common_init, c_common_parse_file): Use finish_options. (handle_deferred_opts): Update. * cppinit.c (struct cpp_pending): Remove imacros_head and imacros_tail. (cpp_finish_options): Don't handle -imacros here. (no_fil): Remove. (COMMAND_LINE_OPTIONS, cpp_handle_option): Don't handle -imacros. From-SVN: r64378
2003-03-14/home/neil/diffs/include.logNeil Booth1-5/+85
From-SVN: r64373
2003-03-10c-opts.c (add_prefixed_path): Don't use concat.Zack Weinberg1-2/+12
* c-opts.c (add_prefixed_path): Don't use concat. When prefixing with cpp_GCC_INCLUDE_DIR, copy only the first cpp_GCC_INCLUDE_DIR_len characters. From-SVN: r64114
2003-03-08c-opts.c (c_common_post_options): On fopen failure, return false, not NULL.Hans-Peter Nilsson1-1/+1
* c-opts.c (c_common_post_options): On fopen failure, return false, not NULL. From-SVN: r64004
2003-03-08c-common.h (c_common_init, [...]): Update.Neil Booth1-25/+32
* c-common.h (c_common_init, c_common_post_options): Update. * c-objc-common.c (c_objc_common_init): Update for new prototype. * c-opts.c (saved_lineno): New. (c_common_post_options, c_common_init): Update prototypes, move call to cpp_read_main_file from latter to former. * c-tree.h (c_ojbc_common_init): Update. * langhooks-def.h (lhd_post_options): New. (LANG_HOOKS_INIT, LANG_HOOKS_POST_OPTIONS): Update. * langhooks.c (lhd_post_options): New. * langhooks.h (struct lang_hooks): Update post_options and init hooks. * toplev.c (no_backend): New. (process_options): Call post_options hook and set main_input_filename and input_filename here. (lang_dependent_init, do_compile): post_options hook moved to process_options. * objc/objc-act.c (objc_init): Update prototype. * objc/objc-act.h (objc_init): Update prototype. ada: * misc.c (gnat_init): Update for new prototype. cp: * cp-tree.h (cxx_init): Update prototype. * lex.c (cxx_init): Similarly. f: * com.c (ffe_init): Update prototype; move code to ffe_post_options. (ffe_post_options): New. java: * lang.c (java_init): Update prototype, move code to java_post_options. (java_post_options): Similarly. treelang: * tree1.c (in_fname): Fix type. (treelang_init): Update prototype and use of in_fname. * treelang.h (in_fname): Fix type. * treetree.c (tree_code_if_start, tree_code_if_else, tree_code_if_end, tree_code_create_function_prototype, tree_code_create_function_initial, tree_code_create_funciton_wrapup, tree_code_create_variable, tree_code_output_expression_statement) : Fix prototypes and use of filenames. * treetree.h: Similarly. From-SVN: r64001
2003-03-06Makefile.in (c-ppoutput.o): Update.Neil Booth1-14/+18
* Makefile.in (c-ppoutput.o): Update. * c-common.h (init_pp_output): New. (preprocess_file): Update. * c-lex.c (init_c_lex): Move mbchar initialization to cpplib. Register builtins. * c-opts.c (c_common_init): Call init_pp_output if preprocessing. Make call to cpp_read_main_file common to whether preprocessing or not. Don't register builtins. * c-ppoutput.c: Include c-pragma.h. (setup_callbacks): Rename init_pp_output. (preprocess_file): No longer setup callbacks or call cpp_read_main_file. * cpphash.h (_cpp_init_mbchar): New. * cppinit.c (init_library): Call _cpp_init_mbchar. * cpplex.c (_cpp_init_mbchar): New. From-SVN: r63913
2003-03-04Makefile.in: Update.Neil Booth1-44/+36
* Makefile.in: Update. * c-common.c (flag_no_line_commands, flag_no_output, flag_dump_macros, flag_dump_includes): New. * c-common.h (flag_no_line_commands, flag_no_output, flag_dump_macros, flag_dump_includes, preprocess_file): New. (init_c_lex): Update prototype. * c-lex.c (init_c_lex): Update prototype; move some code to c_common_init. * c-opts.c (preprocess_file): Subsume into c_common_init. (c_common_decode_option): Update flags. (c_common_init): Move code from preprocess_file and init_c_lex. (sanitize_cpp_opts): Update. * c-ppoutput.c: New, cppmain.c almost verbatim. * cpphash.h (struct printer): Remove. (struct cpp_reader): Remove print. * cpplib.h (dump_none, dump_only, dump_names, dump_definitions, cpp_preprocess_file): Remove. (struct cpp_options): Remove no_output, no_line_commands, dump_macros and dump_includes. * cppmain.c: Remove. * doc/passes.texi: Update. From-SVN: r63773
2003-03-01Makefile.in (C_AND_OBJC_OBJS, [...]): Update.Neil Booth1-7/+99
* Makefile.in (C_AND_OBJC_OBJS, c-incpath.o, c-lex.o, LIBCPP_OBJS, cppinit.o, cppdefault.o, fix-header): Update. * c-incpath.c: New file. * c-incpath.h: New file. * c-lex.c: Include c-incpath.h. (init_c_lex): Register path simplifier. * c-opts.c: Include cppdefault.h and c-incpath.h. (TARGET_SYSTEM_ROOT, verbose, iprefix, sysroot, std_inc, std_cxx_inc, quote_chain_split, add_prefixed_path): New. (COMMAND_LINE_OPTIONS): Add more options from cpplib. (missing_arg, c_common_decode_option): Handle them. (c_common_post_options): Register include chains. (print_help): Update. * cppdefault.h (struct default include): Update. Move some macros to ... * cppdefault.c: ... here. (cpp_include_defaults): Add extra field add_sysroot. * cppfiles.c (include_file, search_from, find_or_create_entry, cpp_included, find_include_file, remap_filename): Update for renaming of search_path to cpp_path, and of the chain headers. (remove_component_p, _cpp_simplify_pathname): Move to c-incpath.c. * cpphash.h (struct search_path): Move to cpplib.h. (struct cpp_buffer, struct cpp_reader): Update. (_cpp_simplify_pathname): Remove. * cppinit.c: Don't include prefix.h and cppdefault.h. (INO_T_EQ, INO_T_COPY, path_include, append_include_chain, remove_dup_dir, remove_dup_nonsys_dirs, remove_dup_dirs, init_standard_includes, BRACKET, SYSTEM, AFTER, no_dir, no_pth, cpp_handle_options): Remove. (struct pending_option): Remove chain members. (cpp_destroy, cpp_read_main_file, COMMAND_LINE_OPTIONS, cpp_handle_option): Update. * cpplib.h (struct cpp_path, cpp_set_include_chains): New. (struct cpp_options): Remove quote_include, bracket_include, include_prefix, include_prefix_len, verbose, ignore_srcdir, no_standard_includes, no_standard_cplusplus_includes. (struct cpp_callbacks): Add simplify_path. (cpp_handle_options): Remove. * fix-header.c: Include c-incpath.h. (read_scan_file): Update to use c-incpath functionality. * doc/passes.texi: Update. cp: * Make-lang.in (CXX_C_OBJS): Update. From-SVN: r63612
2003-02-20re PR fortran/9038 (-ffixed-line-length-none -x f77-cpp-input gives: ↵Toon Moene1-0/+9
Warning: unknown register name line-length-none) 2003-02-20 Toon Moene <toon@moene.indiv.nluug.nl> PR fortran/9038 * c-opts.c (sanitize_cpp_opts): Add Fortran front end options to be ignored. (c_common_decode_option): Ignore them when preprocessing. From-SVN: r63184
2003-01-28cpplib.h (struct cpp_options): Add warn_deprecated field.Jason Merrill1-0/+1
* cpplib.h (struct cpp_options): Add warn_deprecated field. * cppinit.c (cpp_create_reader): Turn it on by default. * c-opts.c (c_common_decode_option): Set it. * cpplib.c (do_pragma_once): Only complain about #pragma once if warn_deprecated is set. From-SVN: r62005
2003-01-18alias.c: Fix comment typos.Kazu Hirata1-1/+1
* alias.c: Fix comment typos. * basic-block.h: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-decl.c: Likewise. * c-opts.c: Likewise. * c-pragma.c: Likewise. * c-pretty-print.h: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfglayout.c: Likewise. * cfgrtl.c: Likewise. * convert.c: Likewise. * cpphash.h: Likewise. * cpplex.c: Likewise. * cpplib.h: Likewise. * df.h: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dwarf2.h: Likewise. From-SVN: r61462
2003-01-10Merge from pch-branch.Geoffrey Keating1-0/+16
From-SVN: r61136
2002-12-16Merge basic-improvements-branch to trunkZack Weinberg1-0/+2
From-SVN: r60174
2002-11-09* c-opts.c (COMMAND_LINE_OPTIONS): Fix -Wimplicit.Neil Booth1-1/+1
From-SVN: r58952
2002-10-21c-opts.c (missing_arg): Use cl_options[opt_index].opt_code instead of just ↵Ulrich Weigand1-1/+1
opt_index as switch expression. * c-opts.c (missing_arg): Use cl_options[opt_index].opt_code instead of just opt_index as switch expression. * calls.c (store_one_arg): Change type of 'excess_align' to unsigned int. * profile.c (output_gcov_string): Change type of 'temp' to size_t. From-SVN: r58381
2002-10-20re PR c/761 (Undocumented options, part 1)Roger Sayle1-7/+0
PR c/761 * toplev.c (flag_unsafe_profile_arcs): Remove. (flag_bounded_pointers): Remove. (flag_bounds_check): Correct comments. (lang_independent_options): Remove -funsafe-profile-arcs and -fbounded-pointers. Correct -fbounds-check comments. * flags.h: Correct flag_schedule_interblock comments. (flag_bounded_pointers): Remove prototype. (flag_bounds_check): Correct comments. * c-opts.c (c_common_init_options): No need to mark flag_bounds_check as unspecified. (c_common_post_options): And no need to set it from flag_bounded_pointers if its still unspecified. * doc/invoke.texi: Fix some overfull hboxes in "make dvi". Document --version, -feliminate-dwarf-2-dups, -fno-sched-interblock, -fno-sched-spec, -fsched-spec-load, -fsched-spec-load-dangerous, -fsched-verbose=n, -fno-branch-count-reg and -fbounds-check. From-SVN: r58334
2002-10-08c-opts.c (c_common_decode_option): Add warn_strict_aliasing to -Wall.Nathan Sidwell1-1/+2
gcc: * c-opts.c (c_common_decode_option): Add warn_strict_aliasing to -Wall. * c-typeck.c (build_c_cast): Use warn_strict_aliasing, tweak message. * flags.h (warn_strict_aliasing): Declare. * toplev.c (warn_strict_aliasing): Define. (lang_independent_options): Add it. * doc/invoke.texi (-Wstrict-aliasing): Document it. testsuite: * gcc.dg/alias-1.c: Tweak expected warning. From-SVN: r57938
2002-10-06cppinit.c (init_standard_includes, [...]): Use strncmp.Frank Ch. Eigler1-2/+2
* cppinit.c (init_standard_includes, parse_option): Use strncmp. * c-opts.c (find_opt): Similarly. From-SVN: r57864
2002-09-23c-common.c (flag_abi_version): New variable.Mark Mitchell1-0/+6
* c-common.c (flag_abi_version): New variable. * c-common.h (flag_abi_version): Declare it. * c-opts.c (missing_arg): Add -fabi-version. (c_common_decode_option): Process -fabi-version. * doc/invoke.texi (-fabi-version): Document it. (-Wabi): Add information about bit-fields in unions. * cp/class.c (layout_virtual_bases): Do not round the size of the type to a multiple of the alignment before laying out virtual bases. (layout_class_type): Correct handling of bit-fields that are wider than their type inside unions. Round the size of the type to a even number of bytes when computing the size without virtual bases. * cp/cp-tree.h (abi_version_at_least): New macro. * g++.dg/abi/bitfield6.C: New test. * g++.dg/abi/bitfield7.C: New test. * g++.dg/abi/bitfield8.C: New test. * g++.dg/abi/vbase11.C: New test. From-SVN: r57432
2002-09-15ChangeLog: Follow spelling conventions.Kazu Hirata1-2/+2
* ChangeLog: Follow spelling conventions. * ChangeLog.0: Likewise. * ChangeLog.1: Likewise. * ChangeLog.2: Likewise. * ChangeLog.3: Likewise. * ChangeLog.4: Likewise. * ChangeLog.5: Likewise. * ChangeLog.6: Likewise. * FSFChangeLog.10: Likewise. * FSFChangeLog.11: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-format.c: Likewise. * c-opts.c: Likewise. * cpplib.c: Likewise. * langhooks.h: Likewise. * real.c: Likewise. * reg-stack.c: Likewise. * toplev.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/arm.md: Likewise. * config/arm/linux-gas.h: Likewise. * config/arm/netbsd.h: Likewise. * config/c4x/c4x.c: Likewise. * config/c4x/c4x.h: Likewise. * config/c4x/c4x.md: Likewise. * config/c4x/libgcc.S: Likewise. * config/fr30/fr30.md: Likewise. * config/frv/frv.md: Likewise. * config/ia64/ia64.md: Likewise. * config/mips/mips.h: Likewise. * config/mn10300/mn10300.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850.md: Likewise. * doc/extend.texi: Likewise. * doc/invoke.texi: Likewise. * doc/md.texi: Likewise. From-SVN: r57166
2002-08-27c-common.c (warn_abi): New variable.Mark Mitchell1-0/+5
* c-common.c (warn_abi): New variable. * c-common.h (warn_abi): Likewise. * c-opts.c (COMMAND_LINE_OPTIONS): Add -Wabi. (c_common_decode_option): Handle it. * doc/invoke.texi:P Document -Wabi. * class.c (layout_virtual_bases): Warn about bugs in G++ that result in incorrect object layouts. (layout_class_type): Likewise. * testsuite/g++.dg/abi/bitfield5.C: New test. * testsuite/g++.dg/abi/vbase10.C: Likewise. From-SVN: r56618
2002-08-27Added -Wundeclared-selector ObjC command line optionNicola Pero1-0/+5
From-SVN: r56615
2002-08-26c-opts.c (find_opt): Don't complain about wrong languages here.Neil Booth1-19/+24
* c-opts.c (find_opt): Don't complain about wrong languages here. Return exact matches even for wrong language. (c_common_decode_option): Complain about wrong languages here. From-SVN: r56583
2002-08-14re PR preprocessor/7358 (Changes to Sun's make Dependencies)Neil Booth1-2/+6
PR preprocessor/7358 * c-opts.c (check_deps_environment_vars): Ignore main file for SUNPRO_DEPENDENCIES. * cppfiles.c (stack_include_file): Ignore main file if appropriate. * cpplib.h (struct cpp_options): New member in deps. * doc/cppenv.texi: Update. From-SVN: r56333
2002-08-14* c-opts.c (c_common_post_options): Correct test.Neil Booth1-1/+1
From-SVN: r56299
2002-08-14c-opts.c (lang_flags): Const-ify.Kaveh R. Ghazi1-1/+1
* c-opts.c (lang_flags): Const-ify. * ra-build.c (undef_table): Likewise. * ra.c (eliminables): Likewise. From-SVN: r56271
2002-08-13opts.c (c_common_init_options): Extra braces needed.Neil Booth1-0/+2
From-SVN: r56262
2002-08-13c-opts.c (c_common_init_options): Check option array is sorted if checking ↵Neil Booth1-0/+8
enabled. * c-opts.c (c_common_init_options): Check option array is sorted if checking enabled. From-SVN: r56241
2002-08-12c-opts.c (deps_seen, [...]): New.Neil Booth1-51/+196
* c-opts.c (deps_seen, deps_file, deferred_count, deferred_size, handle_deferred_opts, sanitize_cpp_opts, defer_opt, struct deferred_opt): New. (COMMAND_LINE_OPTIONS): Add -M*. (missing_arg): Update. (c_common_decode_option): Handle -M*. (c_common_post_options): Handle -M*. Use sanitize_cpp_opts; don't call cpp_post_options. (c_common_finish, check_deps_environment_vars): Update. * cppfiles.c (stack_include_file, handle_missing_header): Update. * cpphash.h (CPP_PRINT_DEPS): Remove. * cppinit.c: Don't include version.h. (cpp_create_reader): Don't call deps_init. Initialize warn_long_long. (cpp_read_main_file): Init deps if necessary. (cpp_destroy): Conditionally free deps. (cpp_finish): Update. (no_tgt): Remove. (COMMAND_LINE_OPTIONS, cpp_handle_option): Remove -M*. (cpp_post_options): Rename post_options. * cpplib.h (struct cpp_options): Remove some dependency options; move others to a new structure. (cpp_post_options): Remove. (cpp_finish): Comment. * fix-header.c (read_scan_file): Don't call cpp_post_options. treelang: * treelang.c: Remove cpp_post_options. From-SVN: r56239
2002-08-12c-common.c (STDC_0_IN_SYSTEM_HEADERS, [...]): Move to c-copts.c.Neil Booth1-7/+60
* c-common.c (STDC_0_IN_SYSTEM_HEADERS, c_common_init): Move to c-copts.c. (warn_multichar): Die. (cb_register_builtins): Export. * c-common.h (warn_multichar, preprocess_file): Remove. (cb_register_builtins): New. * c-lang.c (c_init): Remove. (LANG_HOOKS_INIT): Use c_objc_common_init. * c-lex.c (init_c_lex): Don't canonicalize filename. * c-opts.c (in_fname, STDC_0_IN_SYSTEM_HEADERS): New. (preprocess_file): Make static. Update for cpplib. (c_common_decode_option): Remove warn_multichar. Use in_fname. (c_common_post_options): Set some cpp options here. (c_common_init): Move from c-common.c. * cppinit.c (cpp_post_options): Don't canonicalize in_fname. * cpplib.h (struct cpp_options): Remove in_fname. (cpp_preprocess_file): Update. * cppmain.c (cpp_preprocess_file): Update for new prototypes. From-SVN: r56223
2002-08-11c-common.c (c_common_init): Call preprocess_file instead.Neil Booth1-4/+117
* c-common.c (c_common_init): Call preprocess_file instead. (c_common_finish): Move to c-opts.c. * c-common.h (preprocess_file): new. * c-opts.c (out_fname, out_stream, deps_append, preprocess_file, check_deps_environment_vars, c_common_finish): New. (c_common_decode_option): Update for out_fname and dependencies. * cppinit.c (init_dependency_output, output_deps): Remove. (cpp_destroy): Update prototype. (cpp_add_dependency_target): New. (cpp_read_main_file): Don't overlay a buffer. (cpp_finish): Take a deps output stream and write deps to it. Return the error count. (cpp_post_options): Don't canonicalize out_fname, or do anything with dependencies. * cpplib.h (struct cpp_options): Remove out_fname and preprocess_only. (cpp_add_dependency_target): New. (cpp_destroy, cpp_finish, cpp_preprocess_file): Update. * cppmain.c (cpp_preprocess_file): Update prototype. Don't set preprocess_only. Don't handle the output stream directly. From-SVN: r56214
2002-08-11c-common.h (enum c_language_kind): Emphasize that clk_c is 0.Neil Booth1-51/+60
* c-common.h (enum c_language_kind): Emphasize that clk_c is 0. * c-opts.c (parse_option): Rename find_opt. (set_std_c99): New function. (COMMAND_LINE_OPTIONS): Handle -remap and -o. Remove OPT_std_bad. (missing_arg): Remove OPT_std_bad. Handle -o. (c_common_decode_option): Handle input and output file names, -o and -remap. Clean up -std= handling. * cppinit.c (COMMAND_LINE_OPTIONS): Remove OPT_o and OPT_remap. (cpp_handle_option): Similarly. Don't handle filenames. From-SVN: r56197
2002-08-10c-opts.c (set_std_cxx98, [...]): New.Neil Booth1-25/+61
* c-opts.c (set_std_cxx98, set_std_c89): New. (COMMAND_LINE_OPTIONS): Move more from cppinit.c. (c_common_decode_option): Handle new switches from cppinit.c. Add -std=gnu++98. * cppinit.c (set_lang): Rename cpp_set_lang. Export. (no_arg, no_num): Remove. (COMMAND_LINE_OPTIONS): Move more to c-opts.c. Drop all lang- switches apart from -lang-objc and lang-asm. (cpp_handle_option): Similarly. * cpplib.h (cpp_set_lang): New. * doc/cppopts.texi, doc/invoke.texi: Document -std=c++98, -std=gnu++98. * objc/lang-specs.h: Remove -ansi. cp: * lang-specs.h: Remove -ansi. From-SVN: r56185
2002-08-10c-common.c (flag_objc): New.Ziemowit Laski1-9/+14
2002-08-09 Ziemowit Laski <zlaski@apple.com> * c-common.c (flag_objc): New. * c-common.h (c_language_kind): Get rid of clk_objective_c enum value. (flag_objc): New extern declaration. * c-decl.c (implicitly_declare): Call objc_check_decl instead of maybe_objc_check_decl. (finish_decl): Likewise. (grokfield): Likewise. (finish_struct): Likewise. * c-lang.c (maybe_objc_check_decl): Rename to objc_check_decl. (maybe_objc_comptypes): Rename to objc_comptypes. (maybe_building_objc_message_expr): Rename to objc_message_selector. * c-lex.c (lex_charconst): Remove uses of clk_objective_c, replace with flag_objc as needed. * c-opts.c (c_common_init_options): Likewise. (c_common_decode_option): Likewise. * c-parse.in (init_reswords): Likewise. * c-tree.h (maybe_objc_check_decl): Rename to objc_check_decl. (maybe_objc_comptypes): Rename to objc_comptypes. (maybe_building_objc_message_expr): Rename to objc_message_selector. * c-typeck.c (comptypes): Call objc_comptypes instead of maybe_objc_comptypes, and/or objc_message_selector instead of (comp_target_types): Likewise. (convert_for_assignment): Likewise. (warn_for_assignment): Likewise. * cppinit.c (init_builtins): Set __OBJC__ manifest constant independently of those for other languages. * objc/objc-act.c (maybe_objc_comptypes): Delete. (maybe_objc_check_decl): Delete. (maybe_building_objc_message_expr): Rename to objc_message_selector. * objc/objc-lang.c (objc_init_options): Use clk_c instead of clk_objective_c; set flag_objc flag. From-SVN: r56173
2002-08-09Makefile.in (c-opts.o): UpdateNeil Booth1-47/+228
* Makefile.in (c-opts.o): Update * c-opts.c: Include intl.h. (print_help): Move from cppinit.c. Remove unused options. (COMMAND_LINE_OPTIONS): Move more from cppinit.c. (missing_arg): Complain for switches without an argument. (c_common_decode_option): Reject missing joined arguments. Handle new switches from cppinit.c. * cppinit.c (COMMAND_LINE_OPTIONS): Move some switches to c-opts.c. (cpp_handle_option): Similarly. (print_help): Moved to c-opts.c. * cpplib.h (struct cpp_options): Remove help_only. * gcc.c (cpp_unique_options): Remove -$. * doc/cppopts.texi: Undocument -h. From-SVN: r56155
2002-08-08c-opts.c (cpp_opts): New.Neil Booth1-4/+113
* c-opts.c (cpp_opts): New. (COMMAND_LINE_OPTIONS): Add switches from cppinit.c. (c_common_decode_options): Handle cpplib switches. (c_common_init_options): Set cpp_opts. * cppinit.c (COMMAND_LINE_OPTIONS): Move some switches to c-opts.c. (cpp_handle_option): Similarly. From-SVN: r56119
2002-08-07Makefile.in (c-opts.o, [...]): Update.Neil Booth1-0/+1107
* Makefile.in (c-opts.o, c-common.o, C_AND_OBJC_OBJS): Update. * c-common.c: Don't include tree-inline.h. (c_common_init_options, c_common_post_options): Move to c-opts.c. * c-common.h (c_common_decode_option): New. * c-decl.c (c_decode_option): Remove. * c-lang.c (LANG_HOOKS_DECODE_OPTION): Use c_common_decode_option. * c-opts.c: New file. * c-tree.h (c_decode_option): Remove. * doc/passes.texi: Update. * objc/objc-act.c (objc_decode_option): Remove. * objc/objc-act.h (objc_decode_option): Remove. * objc/ojbc-lang.c (LANG_HOOKS_DECODE_OPTION): Use c_common_decode_option. cp: * Make-lang.in (CXX_C_OBJS): Update. * cp-lang.c (LANG_HOOKS_DECODE_OPTION): Use c_common_decode_option. * cp-tree.h (cxx_decode_option): Remove. * decl2.c (compare_options, lang_f_options, unsupported_options, cxx_decode_option): Remove. testsuite: * objc.dg/const-str-2.m: Update. * gcc.dg/cpp/c++98.c: Change to C extension. * gcc.dg/cpp/c++98-pedantic.c: Similarly. * gcc.dg/cpp/cpp.exp: Process .C extensions too. From-SVN: r56105