aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-opts.c
AgeCommit message (Collapse)AuthorFilesLines
2008-01-02c-opts.c (sanitize_cpp_opts): Don't warn about "long long" when in C++0x mode.Douglas Gregor1-1/+5
2008-01-01 Douglas Gregor <doug.gregor@gmail.com> * c-opts.c (sanitize_cpp_opts): Don't warn about "long long" when in C++0x mode. 2008-01-01 Douglas Gregor <doug.gregor@gmail.com> * parser.c (cp_parser_check_decl_spec): Don't warn about "long long" in C++0x mode; change the warning to note that "long long" is only unsupported in C++98 mode. 2008-01-01 Douglas Gregor <doug.gregor@gmail.com> * g++.dg/cpp0x/long_long.C: New. From-SVN: r131254
2007-12-06re PR c/29172 (--combine can't handle #pragma once)Tom Tromey1-0/+1
gcc PR c/29172: * c-opts.c (c_common_parse_file): Call cpp_clear_file_cache. libcpp PR c/29172: * internal.h (struct cpp_reader) <file_hash_entries>: Changed type. <file_hash_entries_allocated, file_hash_entries_used>: Removed. * files.c (FILE_HASH_POOL_SIZE): New macro. (struct file_hash_entry_pool): New. (destroy_all_cpp_files): New function. (allocate_file_hash_entries): Allocate a file_hash_entry_pool. (new_file_hash_entry): Update. (free_file_hash_entries): New function. (_cpp_cleanup_files): Call free_file_hash_entries and destroy_all_cpp_files. (cpp_clear_file_cache): New function. * include/cpplib.h (cpp_clear_file_cache): Declare. From-SVN: r130656
2007-10-09c-opts.c (c_common_handle_option): -Wnontemplate-friend...Manuel López-Ibáñez1-6/+1
2007-10-09 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * c-opts.c (c_common_handle_option): -Wnontemplate-friend, -Wwrite-strings and -Wmultichar are enabled by default, so Wall enabling them is redundant. Don't check two times for c_dialect_cxx. From-SVN: r129183
2007-09-06tree-cfg.c (remove_bb): Only warn if line is non-zero.Tom Tromey1-4/+4
gcc: * tree-cfg.c (remove_bb): Only warn if line is non-zero. * c-pch.c (c_common_read_pch): Restore current location after reading PCH file. * tree.c (expand_location): Update. (expr_filename): Changed return type. Unified the two cases. (expr_lineno): Likewise. (annotate_with_file_line): Don't use EXPR_LINENO and EXPR_FILENAME as lvalues. * toplev.c (line_table): Changed type. (general_init): Update. (realloc_for_line_map): New function. (general_init): Allocate line_table using GC. * fix-header.c (line_table): Changed type. (read_scan_file): Update. (read_scan_file): Update. * c-ppoutput.c (maybe_print_line): Update. (print_line): Update. (cb_line_change): Update. (cb_define): Update. (pp_file_change): Update. * c-opts.c (c_common_init_options): Update. (finish_options): Update. (push_command_line_include): Update. * c-lex.c (cb_line_change): Update. (cb_def_pragma): Update. (cb_define): Update. (cb_undef): Update. (c_lex_with_flags): Use cpp_get_token_with_location. * input.h (line_table): Changed type. (location_from_locus): New macro. * tree.h (EXPR_FILENAME): No longer an lvalue. (EXPR_LINENO): Likewise. (expr_locus, set_expr_locus): Declare separately for USE_MAPPED_LOCATION. (expr_filename, expr_lineno): Changed return type. * gimplify.c (tree_to_gimple_tuple): Use SET_EXPR_LOCUS. * cfgexpand.c (expand_gimple_cond_expr): Use location_from_locus. (expand_gimple_basic_block): Likewise. * final.c (final_scan_insn): Use expanded_location. gcc/cp: * decl.c (finish_function): Put return's location on line zero of file. gcc/fortran: * scanner.c (get_file): Update. (load_file): Update. (gfc_next_char_literal): Use gfc_linebuf_linenum. * f95-lang.c (gfc_init): Update. * gfortran.h (gfc_linebuf_linenum): New macro. gcc/java: * lang.c (java_post_options): Update. * jcf-parse.c (set_source_filename): Update. (give_name_to_class): Update. (jcf_parse): Update. (duplicate_class_warning): Update. (parse_class_file): Update. (java_parse_file): Update. * expr.c (expand_byte_code): Update. gcc/testsuite: * lib/g++.exp (g++_target_compile): Use -fno-show-column. gcc/treelang: * tree1.c (treelang_init): Update. (treelang_parse_file): Update. (treelang_parse_file): Update. (treelang_parse_file): Update. * lex.l: Update. (update_lineno_charno): Likewise. libcpp: * internal.h (struct cpp_reader) <invocation_location>: New field. (struct cpp_reader) <set_invocation_location>: Likewise. * init.c (cpp_set_line_map): New function. * line-map.c (linemap_add): Use linemap's allocator. * include/line-map.h (GTY): Define. (line_map_realloc): New typedef. (struct line_map): Mark with GTY. (struct line_maps): Likewise. (struct line_maps) <maps>: Likewise. (struct line_maps) <reallocator>: New field. * include/symtab.h (GTY): Conditionally define. * include/cpplib.h (cpp_set_line_map): Declare. (cpp_get_token_with_location): Declare. * macro.c (cpp_get_token): Set invocation_location on the reader. (cpp_get_token_with_location): New function. From-SVN: r128190
2007-09-04* c-opts.c: Include "tm_p.h".Ben Elliston1-0/+1
From-SVN: r128070
2007-08-31c-opts.c (c_common_handle_option): Support -fno-directives-only.Ollie Wild1-1/+1
gcc/ * c-opts.c (c_common_handle_option): Support -fno-directives-only. * gcc.c (default_compilers): Add -fno-directives-only to @assembler-with-cpp. From-SVN: r127952
2007-07-30directives-only.c: New file.Ollie Wild1-0/+19
libcpp/ * directives-only.c: New file. * internal.h (struct _cpp_dir_only_callbacks): New. (_cpp_preprocess_dir_only): New function. * directives.c (_cpp_handle_directive): Check directives_only before disabling execution of indented directives. * files.c (_cpp_stack_file): Add directives_only check. * include/cpplib.h (struct cpp_options): Add directives_only. (cpp_init_special_builtins): New function. * init.c (cpp_init_special_builtins): New function. (cpp_init_builtins): Move builtin_array initialization to cpp_init_special_builtins. (post_options): Check directives_only before setting pfile->state.prevent_expansion = 1. * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__ is expanded inside a directive while -fdirectives-only is enabled. * Makefile.in (libcpp_a_OBJS): Add directives-only.o. (libcpp_a_SOURCES): Add directives-only.c. gcc/ * c-ppoutput.c (print_lines_directives_only): New function. (scan_translation_unit_directives_only): New function. (preprocess_file): Add call to scan_translation_unit_directives_only. * c-opts.c (c_common_handle_option): Add OPT_fdirectives_only. (sanitize_cpp_opts): Add default flag_dump_macros setting for -fdirectives-only. Add errors for -fdirectives-only conflict with -Wunused-macros and -traditional. (finish_options): Add builtin macro initialization for -fdirectives-only + -fpreprocessed. * c.opt (fdirectives-only): New. * doc/cppopts.texi (fdirectives-only): New. gcc/testsuite/ * gcc.dg/cpp/counter-2.c: New test. * gcc.dg/cpp/counter-3.c: New test. * gcc.dg/cpp/dir-only-1.c: New test. * gcc.dg/cpp/dir-only-1.h: New file. * gcc.dg/cpp/dir-only-2.c: New test. * gcc.dg/cpp/dir-only-3.c: New test. * gcc.dg/cpp/dir-only-3a.h: New file. * gcc.dg/cpp/dir-only-3b.h: New file. * gcc.dg/cpp/dir-only-4.c: New test. * gcc.dg/cpp/dir-only-5.c: New test. * gcc.dg/cpp/dir-only-6.c: New test. From-SVN: r127066
2007-07-26Change copyright header to refer to version 3 of the GNU General Public ↵Nick Clifton1-4/+3
License and to point readers at the COPYING3 file and the FSF's license web page. From-SVN: r126948
2007-07-11re PR middle-end/30482 (<complex> division by 0)Paolo Carlini1-5/+3
2007-07-11 Paolo Carlini <pcarlini@suse.de> PR middle-end/30482 * c-opts.c (c_common_post_options): Do not change flag_complex_method conditional to flag_isoc99. (c_common_init_options): Do it here, unconditionally. From-SVN: r126546
2007-07-08revert: c-opts.c (c_common_handle_option): Make DOLLARS_IN_IDENTIFIERS apply ↵Sandra Loosemore1-0/+1
to assembly language, too. 2007-07-08 Sandra Loosemore <sandra@codesourcery.com> Revert this patch: 2007-07-06 Sandra Loosemore <sandra@codesourcery.com> * c-opts.c (c_common_handle_option): Make DOLLARS_IN_IDENTIFIERS apply to assembly language, too. * doc/tm.texi (DOLLARS_IN_IDENTIFIERS): Update. From-SVN: r126458
2007-07-06c-opts.c (c_common_handle_option): Make DOLLARS_IN_IDENTIFIERS apply to ↵Sandra Loosemore1-1/+0
assembly language, too. 2007-07-06 Sandra Loosemore <sandra@codesourcery.com> gcc/ * c-opts.c (c_common_handle_option): Make DOLLARS_IN_IDENTIFIERS apply to assembly language, too. * doc/tm.texi (DOLLARS_IN_IDENTIFIERS): Update. From-SVN: r126427
2007-06-07re PR c++/30759 (initializer-list accepted for object of non-POD type)Simon Martin1-2/+3
gcc/ 2007-06-07 Simon Martin <simartin@users.sourceforge.net> PR c++/30759 * c-common.h (flag_cpp0x): Replaced by... (cxx_dialect): ... this new variable specifying the C++ dialect that is used. * c-common.c (flag_cpp0x): Removed. (cxx_dialect): Defined. * c-cppbuiltin.c (c_cpp_builtins): flag_cpp0x rewritten in terms of cxx_dialect. * c-opts.c (c_common_post_options): Likewise. (set_std_cxx98): Set cxx_dialect to cxx98. (set_std_cxx0x): Set cxx_dialect to cxx0x. gcc/cp/ 2007-06-07 Simon Martin <simartin@users.sourceforge.net> PR c++/30759 * decl.c (check_initializer): Report an error when a brace enclosed initializer is used for a non-aggregate type in C++98. (redeclaration_error_message): Rewrote flag_cpp0x in terms of cxx_dialect. (grokdeclarator): Likewise. (move_fn_p): Likewise. * typeck.c (check_return_expr): Likewise. * call.c (reference_binding): Likewise. * error.c (cp_cpp_error): Likewise. * pt.c (check_default_tmpl_args): Likewise. (tsubst): Likewise. * lex.c (init_reswords): Likewise. * parser.c (p_parser_primary_expression): Likewise. (TOKEN_PRECEDENCE): Likewise. (cp_parser_init_declarator): Likewise. (cp_parser_ptr_operator): Likewise. (cp_parser_parameter_declaration): Likewise. (cp_parser_enclosed_template_argument_list): Likewise. (cp_parser_skip_to_end_of_template_parameter_list): Likewise. (cp_parser_next_token_ends_template_argument_p): Likewise. gcc/testsuite/ 2007-06-07 Simon Martin <simartin@users.sourceforge.net> PR c++/30759 * g++.dg/init/brace6.C: New test. From-SVN: r125539
2007-05-20re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)Manuel López-Ibáñez1-1/+4
2007-05-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 PR c++/11856 PR c/12963 PR c/23587 PR other/29694 * c.opt (Wtype-limits): New. * doc/invoke.texi (Wtype-limits): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * c-common.c (shorten_compare): Warn with Wtype-limits. testsuite/ * gcc.dg/compare6.c: Replace Wall with Wtype-limits. * gcc.dg/Wtype-limits.c: New. * gcc.dg/Wtype-limits-Wextra.c: New. * gcc.dg/Wtype-limits-no.c: New. * g++.dg/warn/Wtype-limits.C: New. * g++.dg/warn/Wtype-limits-Wextra.C: New. * g++.dg/warn/Wtype-limits-no.C: New. From-SVN: r124875
2007-05-19invoke.texi (Warning Options): Add -Wconversion-sign.Manuel López-Ibáñez1-1/+8
2007-05-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * doc/invoke.texi (Warning Options): Add -Wconversion-sign. (Wconversion): Update description. (Wconversion-sign): New. * c.opt (Wconversion-sign): New. * c-opts.c (c_common_post_options): Uninitialized Wconversion-sign means disabled for C++. Otherwise, take the status of Wconversion. * c-common.c (conversion_warning): Warn with either Wconversion or Wconversion-sign. (warnings_for_convert_and_check): Conditions are already checked by conversion_warning. (convert_and_check): Don't check warnings if the conversion failed. cp/ * cvt.c (cp_convert_and_check): Don't check warnings if the conversion failed. testsuite/ * gcc.dg/Wconversion-integer.c: Group testcases and add more. * gcc.dg/Wconversion-sign.c: New. * gcc.dg/Wconversion-integer-no-sign.c: New. * g++.dg/warn/Wconversion-integer.C: Move some warnings to Wconversion-sign.C * g++.dg/warn/Wconversion-sign.C: New. * g++.old-deja/g++.other/warn4.C: Update. * g++.dg/warn/Wconversion1.C: Likewise. From-SVN: r124856
2007-05-11Makefile.in (OBJS-common): Add tree-ssa-alias-warnings.o.Silvius Rus1-1/+1
gcc/ * Makefile.in (OBJS-common): Add tree-ssa-alias-warnings.o. * c-common.c (strict_aliasing_warning): Modify -Wstrict-aliasing logic. * c-common.h (strict_aliasing_warning): Change return type. * c-opts.c (c_common_handle_option): Add call to set_Wstrict_aliasing. * c-typeck.c (build_indirect_ref): Add call to strict_aliasing_warning. (build_c_cast): Condition call to strict_aliasing_warning. * doc/invoke.texi: Update description of -Wstrict-aliasing[=n]. * flags.h (set_Wstrict_aliasing): Declare. * opts.c (set_Wstrict_alising): Define, add call to. * tree-flow.h (strict_aliasing_warning_backend): Declare. * tree-ssa-alias-warnings.c: New file. * tree-ssa-alias.c (compute_may_aliases): Add call to strict_aliasing_warning_backend. gcc/cp * cp/typeck.c (build_indirect_ref): Add call to strict_aliasing_warning. (build_reinterpret_cast_1): Condition call to strict_aliasing_warning. gcc/testsuite * gcc.dg/Wstrict-aliasing-bogus-const-ptr-nonconst-ptr.c: New test. * gcc.dg/Wstrict-aliasing-bogus-never-dereferenced.c: New test. * gcc.dg/Wstrict-aliasing-bogus-struct-included.c: New test. * gcc.dg/Wstrict-aliasing-converted-assigned.c: New test. * gcc.dg/Wstrict-aliasing-float-ptr-int-obj.c: New test. * gcc.dg/alias-1.c: Update option: -Wstrict-aliasing=2. * gcc.dg/alias-9.c: Update option: -Wstrict-aliasing=2. * g++.dg/warn/Wstrict-aliasing-7.C: Update option: -Wstrict-aliasing=2. * g++.dg/warn/Wstrict-aliasing-bogus-base-derived.C: New test. * g++.dg/warn/Wstrict-aliasing-bogus-char-1.C: New test. * g++.dg/warn/Wstrict-aliasing-bogus-const.C: New test. * g++.dg/warn/Wstrict-aliasing-bogus-nested-arrays.C: New test. * g++.dg/warn/Wstrict-aliasing-bogus-signed-unsigned.C: New test. * g++.dg/warn/Wstrict-aliasing-bogus-struct-included.C: New test. * g++.dg/warn/Wstrict-aliasing-bogus-union.C: New test. * g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: New test. From-SVN: r124622
2007-05-07re PR driver/31694 (__GFORTRAN__ preprocessor macro)Francois-Xavier Coudert1-1/+1
PR driver/31694 * c-opts.c (lang_fortran): Make it non static. * c-common.h (lang_fortran): New prototype. * c-cppbuiltin.c (c_cpp_builtins): Create a __GFORTRAN__ if the -lang-fortran option was passed by the driver. From-SVN: r124495
2007-04-17invoke.texi (Debugging Options): Add documentation for the ↵Lawrence Crowl1-0/+12
-femit-struct-debug options... ./: * doc/invoke.texi (Debugging Options): Add documentation for the -femit-struct-debug options -femit-struct-debug-baseonly, -femit-struct-debug-reduced, and -femit-struct-debug-detailed[=...]. * c-opts.c (c_common_handle_option): Add OPT_femit_struct_debug_baseonly, OPT_femit_struct_debug_reduced, and OPT_femit_struct_debug_detailed_. * c.opt: Add specifications for -femit-struct-debug-baseonly, -femit-struct-debug-reduced, and -femit-struct-debug-detailed[=...]. * opts.c (set_struct_debug_option): Parse the -femit-struct-debug-... options. * opts.c (matches_main_base, main_input_basename, main_input_baselength, base_of_path, matches_main_base): Add variables and functions to compare header base name to compilation unit base name. * opts.c (should_emit_struct_debug): Add to determine to emit a structure based on the option. (dump_struct_debug) Also disabled function to debug this function. * opts.c (handle_options): Save the base name of the compilation unit. * langhooks-def.h (LANG_HOOKS_GENERIC_TYPE_P): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Add. This hook indicates if a type is generic. Set it by default to "never generic". * langhooks.h (struct lang_hooks_for_types): Add a new hook to determine if a struct type is generic or not. * cp/cp-tree.h (class_tmpl_impl_spec_p): Declare a C++ hook. * cp/tree.c (class_tmpl_impl_spec_p): Implement the C++ hook. * cp/cp-lang.c (LANG_HOOKS_GENERIC_TYPE_P): Override null C hook with live C++ hook. * flags.h (enum debug_info_usage): Add an enumeration to describe a program's use of a structure type. * dwarf2out.c (gen_struct_or_union_type_die): Add a new parameter to indicate the program's usage of the type. Filter structs based on the -femit-struct-debug-... specification. (gen_type_die): Split into two routines, gen_type_die and gen_type_die_with_usage. gen_type_die is now a wrapper that assumes direct usage. (gen_type_die_with_usage): Replace calls to gen_type_die with gen_type_die_with_usage adding the program usage of the referenced type. (dwarf2out_imported_module_or_decl): Suppress struct debug information using should_emit_struct_debug when appropriate. testsuite/: * g++.dg/other/fesd-any.C: Test -femit-struct-debug-detailed=any. * g++.dg/other/fesd-any.h: Test -femit-struct-debug-detailed=any. * g++.dg/other/fesd-baseonly.C: Test -femit-struct-debug-baseonly. * g++.dg/other/fesd-baseonly.h: Test -femit-struct-debug-baseonly. * g++.dg/other/fesd-none.C: Test -femit-struct-debug-detailed=none. * g++.dg/other/fesd-none.h: Test -femit-struct-debug-detailed=none. * g++.dg/other/fesd-reduced.C: Test -femit-struct-debug-reduced. * g++.dg/other/fesd-reduced.h: Test -femit-struct-debug-reduced. * g++.dg/other/fesd-sys.C: Test -femit-struct-debug-detailed=sys. * g++.dg/other/fesd-sys.h: Test -femit-struct-debug-detailed=sys. * g++.dg/other/fesd.h: Common to -femit-struct-debug-... tests. * gcc.dg/fesd-any.c: Test -femit-struct-debug-detailed=any. * gcc.dg/fesd-any.h: Test -femit-struct-debug-detailed=any. * gcc.dg/fesd-baseonly.c: Test -femit-struct-debug-baseonly. * gcc.dg/fesd-baseonly.h: Test -femit-struct-debug-baseonly. * gcc.dg/fesd-none.c: Test -femit-struct-debug-detailed=none. * gcc.dg/fesd-none.h: Test -femit-struct-debug-detailed=none. * gcc.dg/fesd-reduced.c: Test -femit-struct-debug-reduced. * gcc.dg/fesd-reduced.h: Test -femit-struct-debug-reduced. * gcc.dg/fesd-sys.c: Test -femit-struct-debug-detailed=sys. * gcc.dg/fesd-sys.h: Test -femit-struct-debug-detailed=sys. * gcc.dg/fesd.h: Common to -femit-struct-debug-... tests. From-SVN: r123909
2007-04-07Separate NUL byte detection from rest of -Wformat warningsBruce Korb1-0/+2
From-SVN: r123640
2007-03-15re PR c++/24924 (front end and preprocessor pedantic_errors settings should ↵Manuel López-Ibáñez1-0/+17
agree) 2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c++/24924 * c-opts.c (c_common_post_options): Handle C++ post-processing here. Set also -pedantic-errors by default for the preprocessor unless -fpermissive is given. cp/ * decl.c (cxx_init_decl_processing): Move command-line options processing to c-opts.c. testsuite/ * g++.dg/cpp/pedantic-errors.C: New. * g++.dg/cpp/permissive.C: New. From-SVN: r122961
2007-03-06c-common.c (targetcm): Add.Mike Stump1-1/+7
* c-common.c (targetcm): Add. * c-opts.c (c_common_handle_option): Handle language specific target options. * opts.c (handle_option): Verify language for target options, if any are given. * opth-gen.awk: Add CL_LANG_ALL. * target-def.h (TARGET_HANDLE_C_OPTION): Add. (TARGETCM_INITIALIZER): Add. * target.h (struct gcc_targetcm): Add. (targetcm): Add. * targhooks.c (default_handle_c_option): Add. * targhooks.h (default_handle_c_option): Add. * doc/tm.texi (TARGET_HANDLE_C_OPTION): Add. * config/darwin.opt (iframework): Add. * config/darwin.h (TARGET_HAS_TARGETCM): Add. * config/darwin-c.c (handle_c_option): Add. (TARGET_HANDLE_C_OPTION): Add. (targetcm): Add. * doc/invoke.texi (Darwin Options): Add -iframework. From-SVN: r122590
2007-03-05c.opt (fgnu89-inline): New option.Ian Lance Taylor1-0/+7
* c.opt (fgnu89-inline): New option. * c-opts.c (c_common_post_options): Set default value for flag_gnu89_inline. * c-decl.c (WANT_C99_INLINE_SEMANTICS): Remove. (pop_scope): Check flag_gnu89_inline rather than flag_isoc99 for inline functions. (diagnose_mismatched_decls, merge_decls, start_decl): Likewise. (grokdeclarator, start_function): Likewise. * c-cppbuiltin.c (c_cpp_builtins): Define either __GNUC_GNU_INLINE__ or __GNUC_STDC_INLINE__. * doc/invoke.texi (Option Summary): Mention -fgnu89-inline. (C Dialect Options): Document -fgnu89-inline. * doc/extend.texi (Function Attributes): Explain what the gnu_inline attribute does. * doc/cpp.texi (Common Predefined Macros): Document __GNUC_GNU_INLINE__ and __GNUC_STDC_INLINE__. From-SVN: r122565
2007-02-19c.opt (Waddress): New.Manuel López-Ibáñez1-2/+1
2007-02-19 Manuel Lopez-Ibanez <manu@gcc.gnu.org> * c.opt (Waddress): New. * common.opt (Walways-true): Delete. (Wstring-literal-comparison): Delete. * doc/invoke.texi (Warning Options): Delete -Walways-true and -Wstring-literal-comparison. Add -Waddress. (Waddress): New. (Walways-true): Delete. (Wstring-literal-comparison): Delete. * doc/extend.texi (#pragma GCC diagnostic): Use -Wformat consistently instead of -Walways-true in example. * c-opts.c (c_common_handle_option): -Waddress is enabled by -Wall. * c-typeck.c (parser_build_binary_op): Replace -Wstring-literal-comparison and -Walways-true with -Waddress. * c-common.c (c_common_truthvalue_conversion): Replace -Walways-true with -Waddress. cp/ * typeck.c (build_binary_op): Replace -Wstring-literal-comparison and -Walways-true with -Waddress. * cvt.c (convert_to_void): Replace unconditional warning with -Waddress. testsuite/ * gcc.dg/20031012-1.c: Replace -Walways-true with -Waddress. * gcc.dg/Walways-true-1.c: Likewise. * gcc.dg/weak/weak-3.c: Likewise. * gcc.dg/Werror-1.c: Likewise. * gcc.dg/Werror-3.c: Likewise. * gcc.dg/Werror-4.c: Likewise. * gcc.dg/Werror-5.c: Likewise. * gcc.dg/Werror-6.c: Likewise. * gcc.dg/Werror-7.c: Likewise. * gcc.dg/Werror-8.c: Likewise. * gcc.dg/Werror-10.c: Likewise. * gcc.dg/Werror-11.c: Likewise. * gcc.dg/Werror-12.c: Likewise. * g++.old-deja/g++.mike/warn8.C: Likewise. * g++.dg/warn/Walways-true-1.C: Likewise. * g++.dg/warn/Walways-true-2.C: Likewise. * g++.dg/warn/noeffect8.C: Warn only with -Waddress. * g++.dg/warn/Wstring-literal-comparison-1.C: Replace -Wstring-literal-comparison with -Waddress. * gcc.dg/Wstring-literal-comparison-4.c: Replace -Wno-string-literal-comparison with -Wno-address. From-SVN: r122136
2007-02-15re PR c/26494 (-pedantic-errors can be overridden by -W*)Manuel López-Ibáñez1-9/+9
2007-02-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c/26494 * doc/invoke.texi (Warning Options): Remove -Werror-implicit-function-declaration. (Wimplicit-function-declaration): Update description. * opts.c (common_handle_option): Move handling of -Werror=* to... (enable_warning_as_error): ...here. * opts.h (enable_warning_as_error): Declare. * c-decl.c (implicit_decl_warning): Unless -Wno-implicit-function-declaration is given, emit a pedwarn if -std=c99 or emit a warning if -Wimplicit-function-declaration. * c.opt (Wimplicit-function-declaration): Replace mesg_implicit_function_declaration with warn_implicit_function_declaration. * c-opts.c (c_common_handle_option): -Werror-implicit-function-declaration is exactly equal as -Werror=implicit-function-declaration. (set_Wimplicit): Replace mesg_implicit_function_declaration with warn_implicit_function_declaration. (c_common_post_options): -Wimplict-function-declaration is enabled by default by -std=c99, otherwise is disabled by default. * c-objc-common.c (c_objc_common_init): Remove flawed logic. testsuite/ * gcc.dg/Wimplicit-function-declaration-c89.c: New. * gcc.dg/Wimplicit-function-declaration-c89-default.c: New. * gcc.dg/Wimplicit-function-declaration-c89-pedantic.c: New. * gcc.dg/Wimplicit-function-declaration-c99.c: New. * gcc.dg/Wimplicit-function-declaration-c99-pedantic.c: New. * gcc.dg/Werror-implicit-function-declaration.c: New. From-SVN: r122017
2007-02-13common.opt: Add Wstrict-overflow and Wstrict-overflow=.Ian Lance Taylor1-1/+3
./: * common.opt: Add Wstrict-overflow and Wstrict-overflow=. * flags.h (warn_strict_overflow): Declare. (enum warn_strict_overflow_code): Define. (issue_strict_overflow_warning): New static inline function. * opts.c (warn_strict_overflow): New variable. (common_handle_option): Handle OPT_Wstrict_overflow and OPT_Wstrict_overflow_. * c-opts.c (c_common_handle_option): Set warn_strict_overflow for OPT_Wall. * fold-const.c: Include intl.h. (fold_deferring_overflow_warnings): New static variable. (fold_deferred_overflow_warning): New static variable. (fold_deferred_overflow_code): New static variable. (fold_defer_overflow_warnings): New function. (fold_undefer_overflow_warnings): New function. (fold_undefer_and_ignore_overflow_warnings): New function. (fold_deferring_overflow_warnings_p): New function. (fold_overflow_warning): New static function. (make_range): Add strict_overflow_p parameter. Change all callers. (extract_muldiv, extract_muldiv_1): Likewise. (fold_unary) [ABS_EXPR]: Check ABS_EXPR before calling tree_expr_nonnegative_p. (fold_negate_expr): Call fold_overflow_warning. (fold_range_test): Likewise. (fold_comparison): Likewise. (fold_binary): Likewise. Call tree_expr_nonnegative_warnv_p instead of tree_expr_nonnegative_p. (tree_expr_nonnegative_warnv_p): Rename from tree_expr_nonnegative_p, add strict_overflow_p parameter. (tree_expr_nonnegative_p): New function. (tree_expr_nonzero_warnv_p): Rename from tree_expr_nonzero_p, add strict_overflow_p parameter. (tree_expr_nonzero_p): New function. * passes.c (verify_interpass_invariants): New static function. (execute_one_pass): Call it. * tree-ssa-loop-niter.c (expand_simple_operations): Ignore fold warnings. (number_of_iterations_exit, loop_niter_by_eval): Likewise. (estimate_numbers_of_iterations): Likewise. (scev_probably_wraps_p): Likewise. * tree-ssa-ccp.c: Include "toplev.h". (evaluate_stmt): Defer fold overflow warnings until we know we are going to optimize. (struct fold_stmt_r_data): Add stmt field. (fold_stmt_r): Defer fold overflow warnings until we know we optimized. (fold_stmt): Initialize stmt field of fold_stmt_r_data. (fold_stmt_inplace): Likewise. * tree-cfgcleanup.c: Include "toplev.h" rather than "errors.h". (cleanup_control_expr_graph): Defer fold overflow warnings until we know we are going to optimize. * tree-cfg.c (fold_cond_expr_cond): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (vrp_expr_computes_nonnegative): Call tree_expr_nonnegative_warnv_p instead of tree_expr_nonnegative_p. * tree-ssa-loop-manip.c (create_iv): Likewise. * c-typeck.c (build_conditional_expr): Likewise. (build_binary_op): Likewise. * tree-vrp.c (vrp_expr_computes_nonzero): Call tree_expr_nonzero_warnv_p instead of tree_expr_nonzero_p. (extract_range_from_unary_expr): Likewise. * simplify-rtx.c (simplify_const_relational_operation): Warn when assuming that signed overflow does not occur. * c-common.c (pointer_int_sum): Ignore fold overflow warnings. * tree.h (tree_expr_nonnegative_warnv_p): Declare. (fold_defer_overflow_warnings): Declare. (fold_undefer_overflow_warnings): Declare. (fold_undefer_and_ignore_overflow_warnings): Declare. (fold_deferring_overflow_warnings_p): Declare. (tree_expr_nonzero_warnv_p): Declare. * doc/invoke.texi (Option Summary): Add -Wstrict-overflow to list of warning options. (Warning Options): Document -Wstrict-overflow. * Makefile.in (tree-ssa-threadedge.o): Depend on toplev.h. (tree-ssa-ccp.o): Likewise. (tree-cfgcleanup.o): Change errors.h dependency to toplev.h. (fold-const.o): Depend on intl.h. testsuite/: * gcc.dg/Wstrict-overflow-1.c: New test. * gcc.dg/Wstrict-overflow-2.c: New test. * gcc.dg/Wstrict-overflow-3.c: New test. * gcc.dg/Wstrict-overflow-4.c: New test. * gcc.dg/Wstrict-overflow-5.c: New test. * gcc.dg/Wstrict-overflow-6.c: New test. * gcc.dg/Wstrict-overflow-7.c: New test. * gcc.dg/Wstrict-overflow-8.c: New test. * gcc.dg/Wstrict-overflow-9.c: New test. * gcc.dg/Wstrict-overflow-10.c: New test. From-SVN: r121895
2007-02-04c-opts.c (c_common_post_options): If C++0x mode is enabled, don't warn about ↵Douglas Gregor1-0/+5
C++0x compatibility. 2007-02-03 Douglas Gregor <doug.gregor@gmail.com> * c-opts.c (c_common_post_options): If C++0x mode is enabled, don't warn about C++0x compatibility. From-SVN: r121564
2007-01-25c-common.h (RID_FIRST_CXX0X): New.Douglas Gregor1-0/+1
2007-01-24 Douglas Gregor <dgregor@osl.iu.edu> * c-common.h (RID_FIRST_CXX0X): New. (RID_LAST_CXX0X): New. * c-opts.c (c_common_handle_option): -Wc++0x-compat is triggered by -Wall. * c.opt (Wc++0x-compat): New. * doc/invoke.texi (-Wc++0x-compat): Document. From-SVN: r121162
2007-01-18· Richard Guenther <rguenther@suse.de>Dirk Mueller1-0/+1
2007-01-18 Dirk Mueller <dmueller@suse.de> · Richard Guenther <rguenther@suse.de> · PR diagnostic/8268 · * doc/invoke.texi (Warray-bounds): Document -Warray-bounds. · * common.opt (Warray-bounds): Add new warning option. · * c-opts.c (c_common_handle_option): Define -Warray-bounds · if -Wall is given. * Makefile.in: make tree-vrp.o depend on toplev.h · * tree-vrp.c (vrp_finalize): Call check_array_refs if -Warray-bounds · is enabled. · (check_array_refs, check_array_bounds, check_array_ref): New. · * gcc.dg/Warray-bounds.c: New testcase. * gcc.dg/Warray-bounds-2.c: New testcase. * g++.dg/warn/Warray-bounds.C: New testcase. * g++.dg/warn/Warray-bounds-2.C: New testcase. From-SVN: r120898
2007-01-08c.opt: Add -flax-vector-conversions.Mark Shinwell1-0/+4
gcc/ * c.opt: Add -flax-vector-conversions. * c-typeck.c (convert_for_assignment): Pass flag to vector_types_convertible_p to allow emission of note. (digest_init): Likewise. (comptypes_internal): Use vector_types_convertible_p. * c-opts.c: Handle -flax-vector-conversions. * c-common.c (flag_lax_vector_conversions): New. (vector_types_convertible_p): Unless -flax-vector conversions has been passed, disallow conversions between vectors with differing numbers of subparts and/or element types. If such a conversion is disallowed, possibly emit a note on the first occasion only to inform the user of -flax-vector-conversions. The new last argument specifies this. * c-common.h (flag_lax_vector_conversions): New. (vector_types_convertible_p): Add extra argument. * config/i386/i386.c (ix86_init_mmx_sse_builtins): Use char_type_node for V*QI type vectors. * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Update to satisfy new typechecking rules. * config/rs6000/altivec.h (vec_cmple): Use vec_cmpge. * doc/invoke.texi (C Dialect Options): Document -flax-vector-conversions. gcc/cp/ * call.c (standard_conversion): Pass flag to vector_types_convertible_p to disallow emission of note. * typeck.c (convert_for_assignment): Pass flag to vector_types_convertible_p to allow emission of note. (ptr_reasonably_similar): Pass flag to vector_types_convertible_p to disallow emission of note. gcc/testsuite/ * gcc.target/i386/20020531-1.c: Use "char" not "unsigned char" in __v8qi typedef. * gcc.target/powerpc/altivec-vec-merge.c (foo): Add casts. * gcc.dg/simd-1.c: Update dg-error directives to reflect new compiler behaviour. * gcc.dg/simd-5.c: Likewise. * gcc.dg/simd-6.c: Likewise. * g++.dg/conversion/simd1.C: Likewise. * g++.dg/conversion/simd3.C: Likewise. * g++.dg/ext/attribute-test-2.C (data): Add "vs" member. (main): Use it. From-SVN: r120572
2007-01-02re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)Manuel López-Ibáñez1-1/+4
2007-01-02 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * c.opt (Wold-style-declaration): New. * doc/invoke.texi (C-only Warning Options): New. (Wold-style-declaration): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * c-decl.c (declspecs_add_scspec): Replace -Wextra with -Wold-style-declaration. testsuite/ * gcc.dg/declspec-3.c: Replace -W with -Wold-style-declaration. * gcc.dg/declspec-3-Wextra.c: New. * gcc.dg/declspec-3-no.c: New From-SVN: r120347
2006-12-23re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)Manuel López-Ibáñez1-1/+3
2006-12-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * c.opt (Wmissing-parameter-type): New. * doc/invoke.texi (Wmissing-parameter-type): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * c-decl.c (store_parm_decls_oldstyle): Replace Wextra with Wmissing-parameter-type. testsuite/ * gcc.dg/Wmissing-parameter-type.c: New. * gcc.dg/Wmissing-parameter-type-Wextra.c: New. * gcc.dg/Wmissing-parameter-type-no.c: New. From-SVN: r120173
2006-12-22re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)Manuel López-Ibáñez1-1/+3
2006-12-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * c.opt (Wclobbered): New. * doc/invoke.texi (Wclobbered): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * flow.c (rest_of_handle_life): Replace Wextra with Wclobbered. * function.c (setjmp_vars_warning): Only warn for Wclobbered. (setjmp_args_warning): Likewise. testsuite/ * gcc.dg/attr-returns_twice-1.c: Replace Wextra with Wclobbered. * gcc.dg/setjmp-1.c: Add explicit Wclobbered. From-SVN: r120151
2006-12-16re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)Manuel López-Ibáñez1-2/+5
2006-12-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR middle-end/7651 * c.opt (Wempty-body): New. * doc/invoke.texi (Wempty-body): Document it. (Wextra): Enabled by -Wextra. * c-opts.c (c_common_post_options): Enabled by -Wextra. * c-common.c (empty_body_warning): Replace Wextra with Wempty-body. * c-parser.c (c_parser_c99_block_statement): Likewise. testsuite/ * gcc.dg/20001116-1.c: Replace -Wextra with -Wempty-body. * gcc.dg/if-empty-1.c: Likewise. * gcc.dg/pr23165.c: Likewise. * g++.dg/warn/empty-body.C: Likewise. From-SVN: r119963
2006-12-10c-opts.c (c_common_parse_file): Unconditionally give a warning, suitable for ↵Zack Weinberg1-7/+19
the language, if set_yydebug is true. * c-opts.c (c_common_parse_file): Unconditionally give a warning, suitable for the language, if set_yydebug is true. * c-pragma.h: Define enum pragma_omp_clause here. Don't define YYDEBUG or declare yydebug. * c-parser.c (yydebug, enum pragma_omp_clause): Delete. * cp/parser.c: Likewise. From-SVN: r119704
2006-11-20re PR c++/8586 (-Wwrite-strings should be included in -Wall)Gabriel Dos Reis1-0/+2
2006-11-19 Gabriel Dos Reis <gdr@integrable-solutions.net> PR c++/8586 * c-opts.c (c_common_handle_option): Enable -Wwrite-strings if -Wall. testsuite/ 2006-11-19 Gabriel Dos Reis <gdr@integrable-solutions.net> PR c++/8586 * g++.dg/warn/Wall-write-strings.C: New. From-SVN: r119009
2006-11-01c-common.c (flag_cpp0x): New.Doug Gregor1-1/+19
2006-11-01 Douglas Gregor <doug.gregor@gmail.com> * c-common.c (flag_cpp0x): New. * c-common.h (flag_cpp0x): New. * c-cppbuiltin.c (c_cpp_builtins): If C++0x extensions are supported, define __GXX_EXPERIMENTAL_CPP0X__. * c-opts.c (set_std_cxx0x): New. (c_common_handle_option): Handle -std=c++0x, -std=gnu++0x. * c.opt (std=c++0x): Document. (std=gnu++0x): Ditto. * doc/cpp.texi: Document __GXX_EXPERIMENTAL_CPP0X__. * doc/invoke.texi: Document -std=c++0x, -std=gnu++0x. From-SVN: r118386
2006-09-30re PR c/24010 (Duplicate C99 dot initializer warning missing)Joseph Myers1-2/+4
PR c/24010 * c.opt (Woverride-init): New. * c-opts.c (c_common_post_options): Default warn_override_init to extra_warnings. * c-typeck.c (add_pending_init, output_init_element): Warn for overriding initializers without side effects. * doc/invoke.texi (-Woverride-init): Document. (-Wextra): Update. testsuite: * gcc.dg/Woverride-init-1.c, gcc.dg/Woverride-init-2.c, gcc.dg/Woverride-init-3.c: New tests. From-SVN: r117334
2006-09-17re PR c/25993 (-std= produces incorrect preprocessor output for .S)Steven Bosscher1-5/+14
gcc/ PR c/25993 * c-opts.c (c_common_handle_option): Ignore the -std options if the input language is assembly. testsuite/ PR c/25993 * gcc.dg/pr25993.c: New test. From-SVN: r117005
2006-06-01Suppress extra '#1 <built-in> or '#1 <command line>' on -dD output.Per Bothner1-1/+4
* c-opts.c (finish_options): Use internal line 0 for <command-line>. * c-ppoutput.c (cb_define): Don't increment line 0. From-SVN: r114311
2006-05-18Whitespace fixupsMike Stump1-3/+3
From-SVN: r113893
2006-02-24Index: gcc/ChangeLogGeoffrey Keating1-0/+10
2006-02-24 Geoffrey Keating <geoffk@apple.com> * doc/tm.texi (Run-time Target): Document C_COMMON_OVERRIDE_OPTIONS. * doc/invoke.texi (C++ Dialect Options): Document -fno-use-cxa-get-exception-ptr. * configure.ac: Define DEFAULT_USE_CXA_ATEXIT to 2 not 1. * configure: Regenerate. * c.opt (fuse-cxa-get-exception-ptr): New. * c-opts.c (c_common_handle_option): Handle OPT_fuse_cxa_get_exception_ptr. * c-common.c (flag_use_cxa_atexit): Update documentation. (flag_use_cxa_get_exception_ptr): New. * c-common.h (flag_use_cxa_get_exception_ptr): New. * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Improve documentation. (C_COMMON_OVERRIDE_OPTIONS): New. Index: gcc/testsuite/ChangeLog 2006-02-24 Geoffrey Keating <geoffk@apple.com> * g++.dg/eh/uncaught1.C: Add dg-options for ppc-darwin. * g++.dg/eh/uncaught2.C: New. * g++.dg/eh/uncaught3.C: New. Index: gcc/cp/ChangeLog 2006-02-24 Geoffrey Keating <geoffk@apple.com> * except.c (expand_start_catch_block): Handle flag_use_cxa_get_exception_ptr. From-SVN: r111427
2006-02-13invoke.texi (-Write-strings): Document that it is enabled by default.Gabriel Dos Reis1-0/+1
2006-02-12 Gabriel Dos Reis <gdr@integrable-solutions.net> * doc/invoke.texi (-Write-strings): Document that it is enabled by default. * c.opt (-Wwrite-strings): Declare variable warn_write_strings. Clarify documentation. * c-common.h (warn_write_strings): Remove. * c-common.c (warn_write_strings): Likewise. * c-opts.c (c_common_init_options): Enable -Wwrite-strings by default for C++. testsuite/ 2006-02-12 Gabriel Dos Reis <gdr@integrable-solutions.net> * g++.dg/warn/no-write-strings.C: New test. * g++.dg/warn/write-strings.C: Likewise. * g++.dg/warn/write-strings-default.C: Likewise. From-SVN: r110907
2006-02-09c-common.h (flag_const_strings): Don't declare.Gabriel Dos Reis1-9/+1
2006-02-09 Gabriel Dos Reis <gdr@integrable-solutions.net> * c-common.h (flag_const_strings): Don't declare. * c-common.c (flag_const_strings): Remove. * c.opt (fconst_strings): Remove. * c-opts.c (c_common_handle_option): Remove * <OPT_fconst_strings>. <OPT_Wwrite_strings>: Don't set flag_const_strings. (c_common_init_options): Don't set flag_const_strings. * doc/invoke.texi (-fno-const-strings): Remove documentation. cp/ 2006-02-09 Gabriel Dos Reis <gdr@integrable-solutions.net> * typeck.c (string_conv_p): Don't test for flag_const_strings. testsuite/ 2006-02-09 Gabriel Dos Reis <gdr@integrable-solutions.net> * g++.old-deja/g++.benjamin/15351-2.C: Likewise. * g++.old-deja/g++.benjamin/15351-1.C: Remove. From-SVN: r110804
2006-02-07c.opt: C++ frontend supports -Wdiv-by-zero.Dirk Mueller1-4/+0
2006-02-07 Dirk Mueller <dmueller@suse.com> * c.opt: C++ frontend supports -Wdiv-by-zero. * c-opts.c (c_common_handle_option): Remove dead case. * typeck.c (build_binary_op): Annotate div-by-zero warnings to make -Wno-div-by-zero have an effect. g++.dg/warn/Wdiv-by-zero.C: New test. g++.dg/warn/Wno-div-by-zero.C: New. From-SVN: r110712
2006-01-29c.opt: Add -W(no-)overlength-strings.Zack Weinberg1-0/+8
gcc: * c.opt: Add -W(no-)overlength-strings. * doc/invoke.texi: Document it. * c-opts.c (c_common_handle_option): -pedantic implies -Woverlength-strings, if not explicitly disabled already. (c_common_post_options): -Woverlength-strings defaults to off, and is always off for C++. * c-common.c (fix_string_type): Issue warning about strings longer than is portable only if warn_overlength_strings. Rearrange code a little for clarity. * configure.in: Check for -Wno-overlength-strings as well before enabling -pedantic in stage 1. * Makefile.in (STRICT2_WARN): Add -Wno-overlength-strings. (gcc.o-warn, insn-automata.o-warn, build/gencondmd.o-warn): Delete. * genconditions.c (write_header, write_one_condition) (write_conditions, write_writer): Consolidate very long strings that were broken up to fit in C89 portable limit. Don't use printf when fputs will do. gcc/testsuite: * gcc.dg/Woverlength-strings.c * gcc.dg/Woverlength-strings-pedantic-c89.c * gcc.dg/Woverlength-strings-pedantic-c89-no.c * gcc.dg/Woverlength-strings-pedantic-c99.c * gcc.dg/Woverlength-strings-pedantic-c99-no.c: New tests. ================================================================== From-SVN: r110360
2006-01-26re PR c/25892 (-Wpointer-sign creates problems for Emacs)Alexandre Oliva1-0/+10
gcc/ChangeLog: PR c/25892 * c.opt (Wpointer-sign): Init to -1. * c-opts.c (c_common_handle_option): Set to 1 on OPT_Wall and OPT_pedantic, to 0 otherwise. * doc/invoke.texi: Update. gcc/testsuite/ChangeLog: PR c/25892 * gcc.dg/Wpointer-sign.c: New. * gcc.dg/Wpointer-sign-Wall.c: New. * gcc.dg/Wpointer-sign-Wall-no.c: New. * gcc.dg/Wpointer-sign-pedantic.c: New. * gcc.dg/Wpointer-sign-pedantic-no.c: New. * gcc.dg/conv-2.c: Use -Wpointer-sign. From-SVN: r110265
2006-01-22re PR c++/16190 (-Wnon-virtual-dtor, in -Wall, silenced only by pessimizing ↵Gabriel Dos Reis1-1/+6
code) PR c++/16190 * c-opts.c (c_common_handle_option): Don't include -Wnon-virtual-dtor in -Wall; enable if -Weffc++. * doc/invoke.texi (C++ Dialect Options): Document that -Wnon-virtual-dtor is no longer included in -Wall. From-SVN: r110085
2006-01-20re PR libstdc++/25524 (libstdc++ headers should go in multilib directories)Joseph Myers1-2/+9
PR libstdc++/25524 * cppdefault.h (struct default_include): Add multilib flag. * cppdefault.c (cpp_include_defaults): Set it. * c.opt (-imultilib): New option. * c-opts.c (imultilib): New. (c_common_handle_option): Handle -imultilib. (c_common_post_options): Likewise. * c-incpath.c (add_standard_paths, register_include_chains): Likewise. * c-incpath.h (register_include_chains): Add extra parameter. * gcc.c (do_spec_1): Generate -imultilib option. (The Specs Language): Update %I description. (process_command): Update copyright notice. * doc/cppopts.texi (-imultilib): Document. * doc/invoke.texi (-imultilib): Include in option summary. (%I): Update specs documentation. libstdc++-v3: * include/Makefile.am: Install host-specific headers in multilib subdirectory. * include/Makefile.in: Regenerate. From-SVN: r110037
2005-12-14c-common.c (c_common_truthvalue_conversion): Generalise warning for ↵Ben Elliston1-0/+1
addresses converted to booleans; not just function addresses. * c-common.c (c_common_truthvalue_conversion): Generalise warning for addresses converted to booleans; not just function addresses. * c-typeck.c (build_binary_op): Warn for address comparisons which can never be NULL (eg. func == NULL or &var == NULL). * common.opt (Walways-true): New option. * c-opts.c (c_common_handle_option): Set it with -Wall. * doc/invoke.texi: Document it. testsuite/ * gcc.dg/warn-addr-cmp.c: New test. From-SVN: r108489
2005-12-04re PR c/7776 (const char* p = "foo"; if (p == "foo") ... is compiled without ↵Roger Sayle1-0/+1
warning!) PR c/7776 * common.opt (Wstring-literal-comparison): New command line option. * c-opts.c (c_common_handle_option): Set it with -Wall. * c-typeck.c (parser_build_binary_op): Issue warning if either operand of a comparison operator is a string literal, except for testing equality or inequality against NULL. * doc/invoke.texi: Document new -Wstring-literal-comparison option. * gcc.dg/Wstring-literal-comparison-1.c: New test case. * gcc.dg/Wstring-literal-comparison-2.c: Likewise. * gcc.dg/Wstring-literal-comparison-3.c: Likewise. * gcc.dg/Wstring-literal-comparison-4.c: Likewise. From-SVN: r108018
2005-11-04re PR fortran/18452 (Fortran options induces warning for fortran that needs ↵Francois-Xavier Coudert1-7/+20
preprocessing) PR fortran/18452 * gcc/fortran/lang-specs.h: Pass -lang-fortran to the preprocessor. * gcc/c.opt: Add a -lang-fortran option. * gcc/c-opts.c: Add a lang_fortran flag. (c_common_init_options): Handling the -lang-fortran option. (c_common_handle_option): Add a case for Fortran options in preprocessing. Remove cases for -ffixed-form and -ffixed-line-length. Add a case for -lang-fortran. From-SVN: r106483