aboutsummaryrefslogtreecommitdiff
path: root/gcc/c.opt
AgeCommit message (Collapse)AuthorFilesLines
2009-05-19re PR c/40172 (Revision 147596 breaks bootstrap)Manuel López-Ibáñez1-1/+1
2009-05-19 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/40172 gcc/ * c.opt (Wlogical-op): Disabled by default. * c-opt (c_common_post_options): Do not enable Wlogical-op with Wextra. * doc/invoke.texi (Wlogical-op): Likewise. testsuite/ * gcc.dg/pr40172.c: Add -Wlogical-op to dg-options. From-SVN: r147717
2009-05-07re PR c/39037 (FLOAT_CONST_DECIMAL64 pragma not supported)Janis Johnson1-0/+4
gcc/ PR c/39037 * c-common.h (mark_valid_location_for_stdc_pragma, valid_location_for_stdc_pragma_p, set_float_const_decimal64, clear_float_const_decimal64, float_const_decimal64_p): New. * c.opt (Wunsuffixed-float-constants): New. * c-lex.c (interpret_float): Use pragma FLOAT_CONST_DECIMAL64 for unsuffixed float constant, handle new warning. * c-cppbuiltin.c (c_cpp_builtins): Use cast for double constants. * c-decl.c (c_scope): New flag float_const_decimal64. (set_float_const_decimal64, clear_float_const_decimal64, float_const_decimal64_p): New. (push_scope): Set new flag. * c-parser.c (c_parser_translation_unit): Mark when it's valid to use STDC pragmas. (c_parser_external_declaration): Ditto. (c_parser_compound_statement_nostart): Ditto. * c-pragma.c (valid_location_for_stdc_pragma, mark_valid_location_for_stdc_pragma, valid_location_for_stdc_pragma_p, handle_stdc_pragma, handle_pragma_float_const_decimal64): New. (init_pragma): Register new pragma FLOAT_CONST_DECIMAL64. * cp/semantics.c (valid_location_for_stdc_pragma_p, set_float_const_decimal64, clear_float_const_decimal64, float_const_decimal64_p): New dummy functions. * doc/extend.texi (Decimal Float): Remove statement that the pragma, and suffix for double constants, are not supported. * doc/invoke.texi (Warning Options): List new option. (-Wunsuffixed-float-constants): New. gcc/testsuite PR c/39037 * gcc.dg/Wunsuffixed-float-constants-1.c: New test. * gcc.dg/cpp/pragma-float-const-decimal64-1.c: New test. * gcc.dg/dfp/float-constant-double.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-1.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-2.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-3.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-4.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-5.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-6.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-7.c: New test. * gcc.dg/dfp/pragma-float-const-decimal64-8.c: New test. * g++.dg/cpp/pragma-float-const-decimal64-1.C: New test. From-SVN: r147259
2009-04-20re PR c++/13358 (long long and C++ do not mix well)Manuel López-Ibáñez1-1/+1
2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c++/13358 * doc/invoke.texi (-Wlong-long): Update description. * c-lex (interpret_integer): Only warn if there was no previous overflow and -Wlong-long is enabled. * c-decl.c (declspecs_add_type): Drop redundant flags. * c.opt (Wlong-long): Init to -1. * c-opts.c (sanitize_cpp_opts): Synchronize cpp's warn_long_long and front-end warn_long_long. Wlong-long only depends on other flags if it is uninitialized. * c-parser.c (disable_extension_diagnostics): warn_long_long is the same for CPP and FE. (restore_extension_diagnostics): Likewise. libcpp/ * init.c (cpp_create_reader): Wlong_long is disabled by default. * expr.c (cpp_classify_number): Give different messages for C and C++ front-ends. cp/ * parser.c (cp_parser_check_decl_spec): Drop redundant flags. * error.c (pedwarn_cxx98): New. * cp-tree.h (pedwarn_cxx98): Declare. testsuite/ * gcc.dg/wtr-int-type-1.c: Use two dg-warning to match two messages. Test for "long long" in system headers. * gcc.dg/c99-longlong-2.c: New. * g++.dg/warn/pr13358.C: New. * g++.dg/warn/pr13358-2.C: New. * g++.dg/warn/pr13358-3.C: New. * g++.dg/warn/pr13358-4.C: New. From-SVN: r146459
2009-04-19re PR c/32061 ((Wlogical-op) wording of warning of constant logicials need ↵Manuel López-Ibáñez1-0/+4
improvement) 2009-04-19 Manuel López-Ibáñez <manu@gcc.gnu.org> PR c/32061 PR c++/36954 * doc/invoke.texi: Add -Wlogical-op to -Wextra. * common.opt (Wlogical-op): Move from here... * c.opt (Wlogical-op): ... to here. * c-typeck.c (parser_build_binary_op): Update call to warn_logical_operator. * c-opts.c (c_common_post_options): Enable warn_logical_op with extra_warnings. * c-common.c (warn_logical_op): Update. * c-common.h (warn_logical_op): Update declaration. cp/ * call.c (build_new_op): Save the original codes of operands before folding. testsuite/ * gcc.dg/pr32061.c: New. * gcc.dg/Wlogical-op-1.c: Update. * g++.dg/warn/Wlogical-op-1.C: Update. * g++.dg/warn/pr36954.C: New. From-SVN: r146344
2009-04-15c.opt (Wenum-compare): Enable for C and Objc.Ian Lance Taylor1-1/+1
gcc/: * c.opt (Wenum-compare): Enable for C and Objc. Initialize to -1. * c-opts.c (c_common_handle_option): For C, set warn_enum_compare for -Wall and for -Wc++-compat. (c_common_post_options): For C++, set warn_enum_compare if not already set. * c-tree.h (struct c_expr): Add field original_type. (build_external_ref): Update declaration. * c-parser.c (c_parser_braced_init): Set original_type. (c_parser_initelt): Likewise. (c_parser_expr_no_commas): Likewise. (c_parser_conditional_expression): Likewise. (c_parser_cast_expression): Likewise. (c_parser_unary_expression): Likewise. Pull setting of original_code to top of function. (c_parser_sizeof_expression): Set original_type. (c_parser_alignof_expression): Likewise. (c_parser_postfix_expression): Likewise. Pull setting of original_code to top of function. (c_parser_postfix_expression_after_paren_type): Set original_type. (c_parser_postfix_expression_after_primary): Likewise. (c_parser_expression): Likewise. * c-typeck.c (build_external_ref): Add type parameter. Change all callers. (c_expr_sizeof_expr): Set original_type field. (parser_build_unary_op): Likewise. (parser_build_binary_op): Likewise. Optionally warn about comparisons of enums of different types. (digest_init): Set original_type field. (really_start_incremental_init): Likewise. (push_init_level, pop_init_level): Likewise. * doc/invoke.texi (Warning Options): -Wenum-compare now supported in C. gcc/testsuite/: * gcc.dg/Wenum-compare-1.c: New testcase. From-SVN: r146127
2009-04-07re PR c++/25185 (deep typedef substitution in error message)Jason Merrill1-0/+4
PR c++/25185 * c-common.h, c-common.c: Add flag_pretty_templates. * c-opts.c (c_common_handle_option): Set it. * c.opt: Add -fno-pretty-templates. * doc/invoke.texi (C++ Dialect Options): Likewise. * error.c (dump_function_decl): Don't pretty-print templates if -fno-pretty-templates. (count_non_default_template_args): Print all args if -fno-pretty-templates. From-SVN: r145697
2009-03-18c.opt: Unify help texts for -Wdeprecated, -Wsystem-headers, and -fopenmp.Ralf Wildenhues1-3/+3
gcc/ * c.opt: Unify help texts for -Wdeprecated, -Wsystem-headers, and -fopenmp. gcc/java/ * lang.opt: Unify help text for -Wdeprecated. gcc/fortran/ * lang.opt: Unify help texts for -I, -Wconversion, -d, -fopenmp, and -fpreprocessed. From-SVN: r144943
2009-02-20Update Copyright years for files modified in 2008 and/or 2009.Jakub Jelinek1-1/+2
From-SVN: r144324
2009-02-17re PR target/39082 (union with long double doesn't follow x86-64 psABI)H.J. Lu1-1/+4
gcc/ 2009-02-17 H.J. Lu <hongjiu.lu@intel.com> PR target/39082 * c.opt (Wabi): Support C and ObjC. (Wpsabi): New. * c-opts.c (c_common_handle_option): Handle OPT_Wabi. * config/i386/i386.c (classify_argument): Warn once about the ABI change when passing union with long double. * doc/invoke.texi: Update -Wabi for warning psABI changes. gcc/testsuite/ 2009-02-17 H.J. Lu <hongjiu.lu@intel.com> PR target/39082 * g++.dg/compat/struct-layout-1_generate.c (dg_options): Add -Wno-abi for x86. * gcc.dg/compat/struct-layout-1_generate.c (dg_options): Likewise. * gcc.target/i386/pr39082-1.c: New. * gcc.target/x86_64/abi/abi-x86_64.exp (additional_flags): Add -Wno-abi. * gcc.target/x86_64/abi/args.h (XMM_T): Add _m64 and _m128 if CHECK_M64_M128 is defined. (check_f_arguments): Add "do". (check_vector_arguments): New. (check_m64_arguments): Likewise. (check_m128_arguments): Likewise. * gcc.target/x86_64/abi/defines.h: Include <xmmintrin.h>. (CHECK_M64_M128): Define. * gcc.target/x86_64/abi/test_m64m128_returning.c: New. Based on abitest. * gcc.target/x86_64/abi/test_passing_m64m128.c: Likewise. * gcc.target/x86_64/abi/test_passing_structs.c: Define __m128 tests only if CHECK_M64_M128 is defined. * gcc.target/x86_64/abi/test_passing_structs.c (m128_struct): New. (m128_2_struct): Likewise. (check_struct_passing5): Likewise. (check_struct_passing6): Likewise. (main): Test struct with __m128 if CHECK_M64_M128 is defined. * gcc.target/x86_64/abi/test_passing_unions.c (un4): New. (un5): Likewise. (check_union_passing4): Likewise. (main): Test union with __m128 if CHECK_M64_M128 is defined. From-SVN: r144257
2009-01-28c.opt (Wpacked-bitfield-compat): Change init value to -1.Adam Nemet1-1/+1
* c.opt (Wpacked-bitfield-compat): Change init value to -1. * c-opts.c (c_common_post_options): If -W*packed-bitfield-compat was not supplied then set warn_packed_bitfield_compat to the default value of 1. * stor-layout.c (place_field): Check warn_packed_bitfield_compat against 1. From-SVN: r143718
2009-01-23c-decl.c (finish_struct): Move code to set DECL_PACKED after DECL_BIT_FIELD ↵Adam Nemet1-0/+4
is alreay known. * c-decl.c (finish_struct): Move code to set DECL_PACKED after DECL_BIT_FIELD is alreay known. Also inherit packed for bitfields regardless of their type. * c-common.c (handle_packed_attribute): Don't ignore packed on bitfields. * c.opt (Wpacked-bitfield-compat): New warning option. * stor-layout.c (place_field): Warn if offset of a field changed. * doc/extend.texi (packed): Mention the ABI change. * doc/invoke.texi (-Wpacked-bitfield-compat): Document. (Warning Options): Add it to the list. cp/ * class.c (check_field_decls): Also inherit packed for bitfields regardless of their type. testsuite/ * gcc.dg/bitfld-15.c, gcc.dg/bitfld-16.c, gcc.dg/bitfld-17.c,gcc.dg/bitfld-18.c: New tests. * g++.dg/ext/bitfield2.C, g++.dg/ext/bitfield3.C, g++.dg/ext/bitfield4.C, g++.dg/ext/bitfield5.C: New tests. From-SVN: r143584
2008-11-17re PR middle-end/37908 (atomic NAND op generate wrong code; ↵Uros Bizjak1-0/+4
__sync_nand_and_fetch, __sync_fetch_and_nand) PR middle-end/37908 * optabs.c (expand_sync_operation): Properly handle NAND case by calculating ~(t1 & val) instead of (~t1 & val). * builtins.c (expand_builtin_sync_operation): Warn for changed semantics in NAND builtins. * c.opt (Wsync-nand): New warning option. Describe -Wsync-nand. * doc/invoke.texi (Warning options): Add Wsync-nand. * doc/extend.texi (Atomic Builtins) [__sync_fetch_and_nand]: Correct __sync_fetch_and_nand builtin operation in the example. Add a note about changed semantics in GCC 4.4. [__sync_nand_and_fetch]: Correct __sync_nand_and_fetch builtin operation in the example. Add a note about changed semantics in GCC 4.4. testsuite/ChangeLog: PR middle-end/37908 * gcc.dg/pr37908.c: New test. * gcc.dg/ia64-sync-1.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_si, init_di): Change init value for __sync_fetch_and_nand to -1. (test_si, test_di): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/ia64-sync-2.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_noret_si, init_noret_di): Change init value for __sync_fetch_and_nand to -1. (init_noret_si, init_noret_di): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/sync-2.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_qi, init_qi): Change init value for __sync_fetch_and_nand to -1. (init_hi, init_hi): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/sync-3.c: Copy from sync-2.c instead of including the c source file. * gcc.c-torture/compile/sync-1.c: Add dg-message to look for the warning about changed semantics of NAND builtin. * gcc.c-torture/compile/sync-2.c: Ditto. * gcc.c-torture/compile/sync-3.c: Ditto. From-SVN: r141942
2008-09-18cpplib.h (struct cpp_options): Add new boolean flag ↵Simon Baldwin1-0/+4
warn_builtin_macro_redefined. * include/cpplib.h (struct cpp_options): Add new boolean flag warn_builtin_macro_redefined. * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined. * (struct builtin_operator): Split out from previous struct builtin, enhance extra const correctness. * (struct builtin_macro): Split out from previous struct builtin, add new always_warn_if_redefined flag, enhance const correctness. * (mark_named_operators): Use struct builtin_operator. * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN to builtins selectively. * macro.c (warn_of_redefinition): Return false if a builtin macro is not flagged with NODE_WARN. * c-opts.c (c_common_handle_option): Add handling for -Wbuiltin-macro-redefined command line option. * c.opt: Added builtin-macro-redefined option. * doc/invoke.texi (Warning Options): Add -Wbuiltin-macro-redefined documentation. * gcc.dg/builtin-redefine.c: New. From-SVN: r140461
2008-08-13re PR c/30551 (-pedantic does not include -Wmain, but -pedantic-errors does ↵Manuel López-Ibáñez1-1/+1
make -Wmain cause error messages) 2008-08-13 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 30551 * doc/invoke.texi (Wmain): Update. * c-decl.c (start_decl): warn_main is only 0 or 1. (start_function): Likewise. Fix formatting. (finish_function): Delete redundant warning. * c.opt (Wmain): Add Var(warn_main) and Init(-1). * c-opts (c_common_handle_option): -Wall only has effect if warn_main is uninitialized. OPT_Wmain is automatically handled. -pedantic also enables Wmain. (c_common_post_options): Handle all logic for Wmain here. * c-common.c (warn_main): Delete. (check_main_parameter_types): Make pedwarns conditional on OPT_Wmain. * c-common.h (warn_main): Delete. cp/ * decl.c (grokfndecl): Call check_main_parameters_type only if -Wmain. testsuite/ * gcc.dg/pr30551.c: New. * gcc.dg/pr30551-2.c: New. * gcc.dg/pr30551-3.c: New. * gcc.dg/pr30551-4.c: New. * gcc.dg/pr30551-5.c: New. * gcc.dg/pr30551-6.c: New. * gcc.dg/tree-ssa/reassoc-3.c: Don't compile with -pedantic-errors. * g++.dg/warn/pr30551.C: New. * g++.dg/warn/pr30551-2.C: New. From-SVN: r139063
2008-06-15omp-low.c (extract_omp_for_data): Fix comment typo.Ralf Wildenhues1-1/+1
gcc/ * omp-low.c (extract_omp_for_data): Fix comment typo. * c.opt: Fix typo. gcc/cp/ * parser.c: Fix comment typo. From-SVN: r136804
2008-05-27Fix c++/27975.Michael Matz1-0/+4
* c.opt (Wenum-compare): New warning option. * doc/invoke.texi (Warning Options): Document -Wenum-compare. cp/ * call.c (build_new_op): Make warning conditional on OPT_Wenum_compare. testsuite/ * g++.dg/warn/Wenum-compare.C: New testcase. * g++.dg/warn/Wenum-compare-no.C: Ditto. From-SVN: r136035
2008-05-25re PR fortran/18428 (No preprocessing option -cpp for gfortran)Daniel Franke1-3/+0
gcc: 2008-05-26 Daniel Franke <franke.daniel@gmail.com> PR fortran/18428 * c.opt: Removed undocumented option '-lang-fortran'. * c-common.h: Removed global variable 'lang_fortran'. * c-opts.c (c_common_handle_option): Removed code to handle option '-lang-fortran'. Updated includes. * c-cppbuiltin.c (c_cpp_builtins): Removed conditional definition of '__GFORTRAN__'. (define__GNUC__): Reimplemented to use BASEVER and cpp_define_formatted. (builtin_define_with_value_n): Removed. * c-incpath.h: Renamed to ... * incpath.h: ... this. * c-incpath.c: Renamed to ... * incpath.c: ... this. Updated includes. * fix-header.c: Updated includes. * Makefile.in: Replaced c-incpath.[ch] by incpath.[ch]. (c-cppbuiltin.o): Added dependency on and definition of BASEVER. (OBJ-archive): Added cppdefault.o, incpath.o and prefix.o. gcc/cp: 2008-05-26 Daniel Franke <franke.daniel@gmail.com> * Makefile.in: Adjusted dependencies on c-incpath.o. gcc/fortran: 2008-05-26 Daniel Franke <franke.daniel@gmail.com> PR fortran/18428 * lang.opt (A, C, CC, D, E, H, P, U, cpp, d, fworking-directory, imultilib, iprefix, iquote, isysroot, isystem, nocpp, nostdinc, o, undef, v): New options. * options.c (gfc_init_options): Also initialize preprocessor options. (gfc_post_options): Also handle post-initialization of preprocessor options. (gfc_handle_option): Check if option is a preprocessor option. If yes, let gfc_cpp_handle_option() handle the option. * lang-specs.h: Reorganized to handle new options. * scanner.c (gfc_new_file): Read temporary file instead of input source if preprocessing is enabled. * f95-lang.c (gfc_init): Initialize preprocessor. (gfc_finish): Clean up preprocessor. * cpp.c: New. * cpp.h: New. * Make-lang.in: Added new objects and dependencies. * gfortran.texi: Updated section "Preprocessing and conditional compilation". * invoke.texi: Added new section "Preprocessing Options", listed and documented the preprocessing options handled by gfortran. From-SVN: r135882
2008-05-22c.opt (Wimport): Mark as undocumented.Tom Tromey1-2/+1
* c.opt (Wimport): Mark as undocumented. * doc/invoke.texi (Option Summary): Don't mention -Wimport or -Wno-import. (Warning Options): Likewise. * doc/cppopts.texi: Don't mention -Wimport. From-SVN: r135747
2008-05-13re PR preprocessor/22168 (#if #A == #B should have a diagnostic in ISO C mode)Tom Tromey1-1/+1
libcpp PR preprocessor/22168: * include/cpplib.h (struct cpp_options) <objc>: Update documentation. * expr.c (eval_token): Warn for use of assertions. * directives.c (directive_diagnostics): Warn about extensions. (DEPRECATED): New define. (DIRECTIVE_TABLE): Use it. gcc PR preprocessor/22168: * doc/cpp.texi (Top): Update menu. (Alternatives to Wrapper #ifndef): New node. (Other Directives): Document deprecation. (Obsolete Features): Remove menu. (Assertions): Merge node into Obsolete Features. (Obsolete once-only headers): Move earlier; rename to Alternatives to Wrapper #ifndef. * doc/cppopts.texi: Update. * c.opt (Wdeprecated): Enable for C and ObjC. * doc/invoke.texi (Option Summary): Move -Wno-deprecated. (C++ Dialect Options): Move -Wno-deprecated from here to... (Warning Options): ... here. gcc/testsuite PR preprocessor/22168: * gcc.dg/pch/import-2.hs: Add -Wno-deprecated. * gcc.dg/pch/import-1.hs: Add -Wno-deprecated. * gcc.dg/pch/import-2.c: Add -Wno-deprecated. * gcc.dg/pch/import-1.c: Add -Wno-deprecated. * gcc.dg/cpp/import2.c: Add -Wno-deprecated. * gcc.dg/cpp/import1.c: Add -Wno-deprecated. * gcc.dg/cpp/trad/assert3.c: Add -Wno-deprecated. * gcc.dg/cpp/trad/assert2.c: Add -Wno-deprecated. * gcc.dg/cpp/trad/assert1.c: Add -Wno-deprecated. * gcc.dg/cpp/ident.c: Add -Wno-deprecated. * gcc.dg/cpp/ident-1.c: Add -Wno-deprecated. * gcc.dg/cpp/extratokens.c: Add -Wno-deprecated. * gcc.dg/cpp/assert3.c: Add -Wno-deprecated. * gcc.dg/cpp/assert2.c: Add -Wno-deprecated. * gcc.dg/cpp/assert1.c: Add -Wno-deprecated. * gcc.dg/cpp/assert4.c: Compile with -ansi and not -pedantic. Add -Wno-deprecated. * gcc.dg/cpp/pr22168.c: New file. * gcc.dg/cpp/pr22168-2.c: New file. From-SVN: r135264
2008-03-09c.opt (Wsynth): Deprecate.Ralf Wildenhues1-1/+1
gcc/ * c.opt (Wsynth): Deprecate. * doc/invoke.texi (Option Summary, Warning Options): Document -Wno-format-contains-nul. gcc/fortran/ * invoke.texi (Error and Warning Options): Document -Wline-truncation. contrib/ * check_warning_flags.sh: Instead of invoke.texi, take the path to the doc directory as argument. Check that warnings listed in 'gcc --help' are accepted by the compiler, and listed in the manuals. From-SVN: r133059
2008-02-26re PR c/34351 (Please get us the "volatile register" warning back)Manuel López-Ibáñez1-0/+4
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR 34351 * doc/invoke.texi (-Wall): Add -Wvolatile-register-var. * c-opts.c (c_common_handle_option): Wall enables Wvolatile-register-var. * common.opt: Move Wvolatile-register-var to... * c.opt: ...here. testsuite/ * gcc.dg/pr34351.c: New. From-SVN: r132675
2008-02-24http://gcc.gnu.org/ml/gcc-patches/2008-02/msg01094.htmlDiego Novillo1-4/+0
PR 33738 * tree-vrp.c (vrp_evaluate_conditional): With -Wtype-limits, emit a warning when comparing against a constant outside the natural range of OP0's type. * c.opt (Wtype-limits): Move ... * common.opt (Wtype-limits): ... here. testsuite/ChangeLog PR 33738 * g++.dg/warn/pr33738.C: New. From-SVN: r132591
2008-02-19re PR other/31349 (gcc -v --help returns no options for C, C++)Nick Clifton1-1/+1
PR other/31349 * opts.c (undocumented_msg): Leave blank unless checking is enabled. (handle_options): Fix indentation. (print_filtered_help): If no language-specific options were displayed tell the user how to list all the options supported by the language's front-end. (print_specific_help): Fix indentation and remove duplicate line. (common_handle_option): Handle the -v option. For --help enable the display of undocumented options if the -v switch has been included on the command line. For --help= check for overlaps in the arguments between the option classes and the language names and issue a warning when they cannot be disambiguated. * c.opt (v): Pass on to the common option handler. From-SVN: r132427
2008-01-13c-decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers instead of ↵Doug Kwan1-0/+4
OPT_Wreturn_type in... ChangeLog: 2008-01-12 Doug Kwan <dougkwan@google.com> * c-decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers instead of OPT_Wreturn_type in warning due to ignored return type qualifiers. * c-opt.c (c_common_post_option): Add -Wignored-qualifiers to options included in -Wextra. * c.opt: New option -Wignored_qualifiers. * doc/invoke.texi (Warning Options, -Wextra): Add new option -Wignore_qualifiers. (-Wignored-qualifiers): Document. (-Wreturn-type): Remove description of functionality now handled by -Wignored-qualifiers. cp/ChangeLog: 2008-01-12 Doug Kwan <dougkwan@google.com> * decl.c: (grokdeclarator): Use OPT_Wignored_qualifiers instead of OPT_Wreturn_type in warning due to ignored return type qualifiers. * pt.c: (tsubst_function_type): Use OPT_Wignored_qualifiers instead of OPT_Wreturn_type in warning due to ignored return type qualifiers. testsuite/ChangeLog: 2008-01-12 Doug Kwan <dougkwan@google.com> * gcc.dg/qual-return-1.c: Add -Wignored-qualifiers. * g++.dg/warn/Wreturn-type-4.C: Replace -Wreturn-type by -Wignored-qualifiers. From-SVN: r131499
2007-07-30directives-only.c: New file.Ollie Wild1-0/+4
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-06-28Index: gcc/ChangeLogGeoffrey Keating1-0/+4
2007-06-21 Geoffrey Keating <geoffk@apple.com> * doc/invoke.texi (C++ Dialect Options): Document fvisibility-ms-compat. * c.opt (fvisibility-ms-compat): New. Index: gcc/cp/ChangeLog 2007-06-21 Geoffrey Keating <geoffk@apple.com> * decl2.c (determine_visibility): Implement flag_visibility_ms_compat effect on type info. * decl.c (cxx_init_decl_processing): Implement global effect of flag_visibility_ms_compat. Index: gcc/testsuite/ChangeLog 2007-06-26 Geoffrey Keating <geoffk@apple.com> * g++.dg/ext/visibility/ms-compat-1.C: New. From-SVN: r126088
2007-05-20re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)Manuel López-Ibáñez1-0/+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-0/+4
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-04c.opt (Wmain,ffreestanding): Enable for C++,ObjC++.Dirk Mueller1-2/+2
2007-05-04 Dirk Mueller <dmueller@suse.de> * c.opt(Wmain,ffreestanding): Enable for C++,ObjC++. * cp-tree.h (DECL_MAIN_P): only if -ffreestanding is not in effect. From-SVN: r124404
2007-04-23c.opt (Wformat-contains-nul): Add warning attribute.Nick Clifton1-1/+1
From-SVN: r124063
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/+4
From-SVN: r123640
2007-03-21* c.opt: Fixup for Objective-C/C++.Mike Stump1-4/+4
From-SVN: r123114
2007-03-12invoke.texi (Wvla): New warning.Seongbae Park1-0/+4
ChangeLog: 2007-03-12 Seongbae Park <seongbae.park@gmail.com> * gcc/doc/invoke.texi (Wvla): New warning. gcc/ChangeLog: 2007-03-12 Seongbae Park <seongbae.park@gmail.com> * c-decl.c (warn_variable_length_array): New function. Refactored from grokdeclarator to handle warn_vla and handle unnamed array case. (grokdeclarator): Refactored VLA warning case. * c.opt (Wvla): New flag. gcc/cp/ChangeLog: 2007-03-12 Seongbae Park <seongbae.park@gmail.com> * decl.c (compute_array_index_type): New warning flag warn_vla. gcc/testsuite/ChangeLog: 2007-03-12 Seongbae Park <seongbae.park@gmail.com> * gcc.dg/wvla-1.c: New test * gcc.dg/wvla-2.c: New test * gcc.dg/wvla-3.c: New test * gcc.dg/wvla-4.c: New test * gcc.dg/wvla-5.c: New test * gcc.dg/wvla-6.c: New test * gcc.dg/wvla-7.c: New test * g++.dg/warn/Wvla-1.C: New test * g++.dg/warn/Wvla-2.C: New test * g++.dg/warn/Wvla-3.C: New test From-SVN: r122851
2007-03-05c.opt (fgnu89-inline): New option.Ian Lance Taylor1-1/+5
* 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-21common.opt (Warray-bounds): Add Warning attribute.Nick Clifton1-1/+1
* common.opt (Warray-bounds): Add Warning attribute. (Wstrict-overflow, Wstrict-overflow=, Wcoverage-mismatch): Likewise. (fsized-zeroes): Add Optimization attribute. (fsplit-wide-types, ftree-scev-cprop): Likewise. * c.opt (Wc++0x-compat): Add Warning attribute. From-SVN: r122200
2007-02-19c.opt (Waddress): New.Manuel López-Ibáñez1-0/+4
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-2/+2
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-12invoke.texi (Overall Options): Document --help=.Nick Clifton1-89/+89
* doc/invoke.texi (Overall Options): Document --help=. * gcc.c (target_help_flag): Rename to print_subprocess_flag. (cc1_options): Pass --help= on to cc1. (display_help): Add description of --help=. (process_command): Add code to handle --help=. Allow translated --help and --target-help switches to be passed on to compiler sub-process. (main): Remove unused if statement. * opts.c (columns): Remove. (LEFT_COLUMN): Define. (wrap_help): Add columns argument. (print_filtered_help): Change parameters to be an include bitmask, an exclude bitmask, an any bitmask and the column width. Move the code to display the params list here. Add code to display the status of options rather than their descriptions if the quiet flag is not active. (print_specific_help): Change parameters to be an include bitmask, an exclude bitmask and an any bitmask. Move code to look up the column width here. Decide upon the title for an options listing. (common_handle_options): Add code to handle --help=. Adapt code for --help and --target-help to use the revised form of the print_specific_help function. (print_help): Delete. (print_param_help): Delete. (print_switch): Delete. * opts.h (cl_lang_count): Add prototype. (CL_PARAMS, CL_WARNING, CL_OPTIMIZATION, CL_MIN_OPTION_CLASS, CL_MAX_OPTION_CLASS): New defines. * optc-gen.awk: Add construction of cl_lang_count. * c.opt: Add Warning attribute to warning options and Optimization attribute to optimization options. * common.opt: Likewise. Add --help=. Add -fhelp and -ftarget-help as aliases for the transformed --help and --target-help options. * opt-functions.awk: Add code to handle Warning and Optimization attributes. From-SVN: r121849
2007-01-25c-common.h (RID_FIRST_CXX0X): New.Douglas Gregor1-0/+3
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-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-0/+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-0/+4
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-0/+4
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-18c.opt (Wmissing-declarations): Add C++ and ObjC++.Ian Lance Taylor1-1/+1
./: * c.opt (Wmissing-declarations): Add C++ and ObjC++. * doc/invoke.texi (Warning Options): -Wmissing-declarations now works for C++. cp/: * decl.c (start_preparsed_function): Add support for -Wmissing-declarations. testsuite: * g++.dg/warn/Wmissing-declarations-1.C: New test. From-SVN: r120012
2006-12-16re PR middle-end/7651 (Define -Wextra strictly in terms of other warning flags)Manuel López-Ibáñez1-0/+4
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-11-25c.opt: Remove -ffixed-form, -ffixed-line-length-none, and ↵Brooks Moses1-9/+0
-ffixed-line-length-* options. * c.opt: Remove -ffixed-form, -ffixed-line-length-none, and -ffixed-line-length-* options. From-SVN: r119206
2006-11-23re PR c/9072 (-Wconversion should be split into two distinct flags)Manuel López-Ibáñez1-1/+5
2006-11-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c/9072 * c.opt (Wtraditional-conversion): New. (Wconversion): Update description. * c-typeck.c (convert_arguments): Warnings for prototypes causing type conversions different from what would happen in the absence of prototype are now handled by Wtraditional-conversion. * doc/invoke.texi (Wtraditional-conversion): New. (Wconversion): Update description. * doc/trouble.texi (Wconversion): Replace Wconversion by Wtraditional-conversion. testsuite/ PR c/9072 * gcc.dg/builtin-protos-1.c: Replace Wconversion by Wtraditional-conversion. * gcc.dg/overflow-warn-2.c: Likewise. * gcc.dg/Wconversion.c: Likewise. Renamed as Wtraditional-conversion.c . * gcc.dg/Wconversion-2.c: Likewise. Renamed as Wtraditional-conversion-2.c . * gcc.dg/dfp/Wconversion-2.c: Likewise. Renamed as Wtraditional-conversion-2.c * gcc.dg/Wconversion-negative-constants.c: New. From-SVN: r119129
2006-11-01c-common.c (flag_cpp0x): New.Doug Gregor1-0/+14
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