aboutsummaryrefslogtreecommitdiff
path: root/gcc/c.opt
AgeCommit message (Collapse)AuthorFilesLines
2005-01-18[multiple changes]Andreas Jaeger1-1/+5
2005-01-18 Andi Kleen <ak@muc.de> * c-typeck.c: (convert_for_assignment): Check warn_pointer_sign. * c.opt (-Wpointer-sign): Add. * doc/invoke.texi: (-Wpointer-sign): Add. 2005-01-18 Michael Matz <matz@suse.de> * gcc.dg/Wno-pointer-sign.c: New test for -Wno-pointer-sign. From-SVN: r93813
2004-08-27re PR c++/13684 (local static object variable constructed once but ctors and ↵Jason Merrill1-0/+4
dtors called multiple times on same memory when called in multiple threads) PR c++/13684 * cp/decl.c (expand_static_init): Use thread-safety API. (register_dtor_fn): Return the call, don't expand it. * cp/tree.c (add_stmt_to_compound): New fn. (stabilize_call): Use it. * gimplify.c (gimplify_cleanup_point_expr): Handle CLEANUP_EH_ONLY. (gimple_push_cleanup): Add eh_only parm. (gimplify_target_expr): Pass it. * c.opt (-fno-threadsafe-statics): New option. * c-opts.c (c_common_handle_option): Handle it. * c-common.h (flag_threadsafe_statics): Declare it. * c-common.c (flag_threadsafe_statics): Record it. * doc/invoke.texi: Document it. * tsystem.h (_GNU_SOURCE): Define. * gthr-posix.h (__gthread_recursive_mutex_t): New typedef. (__GTHREAD_RECURSIVE_MUTEX_INIT): New macro. (__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): New macro. (__gthread_recursive_mutex_init_function): New fn. (__gthread_recursive_mutex_lock): New fn. (__gthread_recursive_mutex_trylock): New fn. (__gthread_recursive_mutex_unlock): New fn. * gthr-solaris.h, gthr-single.h, gthr-dce.h: Likewise. * gthr-win32.h, gthr-vxworks.h: Likewise. * gthr.h: Document. * libsupc++/guard.cc (static_mutex): Internal class implementing a recursive mutex which controls initialization of local statics. (__gnu_cxx::recursive_init): New exception class. (__cxa_guard_acquire): Deal with locking and recursion detection. (acquire_1, __cxa_guard_abort, __cxa_guard_release): Likewise. From-SVN: r86687
2004-08-06re PR c/13282 (A "-Wno..." switch to turn off "missing initializer" warnings)Richard Sandiford1-0/+4
PR c/13282 * c.opt (Wmissing-field-initializers): New option. * c-opts.c (c_common_post_options): Make -Wextra turn it on by default. * c-typeck.c (pop_init_level): Guard the missing field warning with warn_missing_field_initializers rather than extra_warnings. * doc/invoke.texi (-Wmissing-field-initializers): Document, moving some of the explanation from... (-Wextra): ...here. Say that the missing field warning can be seperately controlled by -Wmissing-field-initializers. cp/ * typeck2.c (process_init_constructor): Guard the missing field warning with warn_missing_field_initializers rather than extra_warnings. testsuite/ * gcc.dg/missing-field-init-[12].c: New tests. * g++.dg/warn/missing-field-init-[12].C: New tests. From-SVN: r85638
2004-07-25re PR c++/9283 (__attribute__((visibility ("hidden"))) not supported for ↵Niall Douglas1-0/+4
class/struct) PR c++/9283 PR c++/15000 * c-common.c (c_common_attribute_table): Allow handle_visibility_attribute to be called for types. (handle_visibility_attribute) When given a type, set the visibility bits on the TYPE_NAME. When given a decl, don't set no_add_attrs so that we can check later whether the attribute was present. Added warning if attribute applied to non class type. * c-decl.c (diagnose_mismatched_decls): Updated rules for merging decls and checking that they are consistent. * common.opt: Added -fvisibility. * c.opt, c-opts.c: Added -fvisibility-inlines-hidden. * c-pragma.h, c-pragma.c: Added handle_pragma_visibility(). * flags.h, tree.h: Added assorted support defines for overall patch * opts.c: Added parsing support for -fvisibility. * tree.c (build_decl): Set visibility for all decls to be whatever is in force at that time. * varasm.c (default_binds_local_p_1): Reworked logic determining when to make a symbol locally bound. * doc/invoke.texi: Added documentation for -fvisibility and -fvisibility-inlines-hidden. PR c++/15000 PR c++/9283 * class.c (check_field_decls): Apply hidden visibility if -fvisibility-inlines-hidden and inlined unless otherwise specified (build_vtable): Set vtable visibility to class visibility. (check_field_decls): Default static member visibility to class visibility. (check_methods): Default method visibility to class visibility. * cp-tree.h: Added CLASSTYPE_VISIBILITY and CLASSTYPE_VISIBILITY_SPECIFIED macro. * decl.c (duplicate_decls): New logic for merging definition decls with declaration decls. Added ignore & warning when non default applied to global operator new or delete. * method.c, optimize.c, rtti.c: Added setting of VISIBILITY_SPECIFIED wherever VISIBILITY was changed * rtti.c (get_tinfo_decl): Set typeinfo visibility to class visibility. (tinfo_base_init): Set typeinfo name visibility to class visibility. PR c++/9283 PR c++/15000 * gcc.dg/visibility-9.c, gcc.dg/visibility-a.c: New tests. * g++.dg/ext/visibility/: New directory. * g++.dg/ext/visibility-1.C, g++.dg/ext/visibility-2.C g++.dg/ext/visibility-3.C, g++.dg/ext/visibility-4.C, g++.dg/ext/visibility-5.C, g++.dg/ext/visibility-6.C, g++.dg/ext/visibility-7.C: Move to g++.dg/ext/visibility/. * g++.dg/ext/visibility/fvisibility.C, g++.dg/ext/visibility/fvisibility-inlines-hidden.C, g++.dg/ext/visibility/fvisibility-override1.C g++.dg/ext/visibility/fvisibility-override2.C g++.dg/ext/visibility/memfuncts.C g++.dg/ext/visibility/noPLT.C g++.dg/ext/visibility/pragma.C g++.dg/ext/visibility/pragma-override1.C g++.dg/ext/visibility/pragma-override2.C g++.dg/ext/visibility/staticmemfuncts.C g++.dg/ext/visibility/virtual.C: New tests. Co-Authored-By: Brian Ryner <bryner@brianryner.com> From-SVN: r85167
2004-06-27re PR c++/15145 (Implementing -Wsequence-point for C++ would be very useful)Andrew Pinski1-1/+1
2004-06-27 Andrew Pinski <pinskia@physics.uc.edu> PR c++/15145 * c.opt (Wsequence-point): Enable for C++ and ObjC++. From-SVN: r83758
2004-06-25c-common.h (warn_cast_qual, [...]): Remove explicit declarations.DJ Delorie1-46/+50
* c-common.h (warn_cast_qual, warn_missing_format_attribute, warn_pointer_arith, warn_missing_prototypes, warn_parentheses, warn_missing_braces, warn_sign_compare, warn_long_long, warn_redundant_decls, warn_float_equal, warn_char_subscripts, warn_conversion, warn_format_y2k, warn_format_extra_args, warn_format_zero_length, warn_format_nonliteral, warn_format_security, mesg_implicit_function_declaration, warn_bad_function_cast, warn_traditional, warn_declaration_after_statement, warn_strict_prototypes, warn_missing_declarations, warn_nested_externs, warn_sequence_point, warn_init_self, warn_div_by_zero, warn_implicit_int, warn_nonnull, warn_old_style_definition, warn_selector, warn_undeclared_selector, warn_protocol, warn_abi, warn_invalid_offsetof, warn_ctor_dtor_privacy, warn_overloaded_virtual, warn_nonvdtor, warn_reorder, warn_synth, warn_pmf2ptr, warn_ecpp, warn_sign_promo, warn_old_style_cast, warn_nontemplate_friend, warn_deprecated): Remove explicit declarations. * c-common.c: Likewise, remove explicit definitions. * c-opts.c: Likewise, remove explicit assignments. * c.opts: Likewise, add implicit declare/define/assign. From-SVN: r83680
2004-06-22c-opts.c (c_common_handle_option): Handle -fpch-preprocess.Geoffrey Keating1-0/+4
2004-06-21 Geoffrey Keating <geoffk@apple.com> * c-opts.c (c_common_handle_option): Handle -fpch-preprocess. * c-common.h (flag_pch_preprocess): Declare. (c_common_pch_pragma): Likewise. * c-common.c (flag_pch_preprocess): New. * c-pch.c (c_common_read_pch): Support -fpreprocess-only. (c_common_pch_pragma): New. * c-ppoutput.c (cb_read_pch): New. (init_pp_output): Support -fpch-preprocess. * c-pragma.c (init_pragma): Support #pragma GNUC pch_preprocess. * c.opt (fpch-preprocess): New. * gcc.c (cpp_options): When save-temps, pass -fpch-preprocess. * doc/cppopts.texi: Document -fpch-preprocess. * doc/invoke.texi (Precompiled Headers): Mention that -fpreprocessed is safe for PCH. Mention that if an option is listed as safe that doesn't mean it does what you expect. Index: gcc/testsuite/ChangeLog 2004-06-21 Geoffrey Keating <geoffk@apple.com> * gcc.dg/pch/save-temps-1.c: New file. * gcc.dg/pch/save-temps-1.hs: New file. Index: libcpp/ChangeLog 2004-06-21 Geoffrey Keating <geoffk@apple.com> * files.c (should_stack_file): Correct swapped parameters to call to cb.read_pch. * pch.c (cpp_valid_state): Handle -fpreprocessed. From-SVN: r83478
2004-06-17c-common.c (flag_objc_sjlj_exceptions): New.Richard Henderson1-0/+4
* c-common.c (flag_objc_sjlj_exceptions): New. * c-common.h (flag_objc_sjlj_exceptions): Declare. * c-opts.c (c_common_handle_option): Set it. (c_common_post_options): Handle interation of different objective-c exception and runtime switches. * c-decl.c (c_eh_initialized_p): New. (finish_decl): Use it instead of local eh_initialized_p. * c-parse.in (nested_function, notype_nested_function): Record the result of compstmt. (compstmt_or_error): Likewise. (compstmt): Don't add_stmt the result. (stmt): Don't return anything. Rewrite objc try and sync rules. (objc_try_stmt, objc_catch_list): Remove. (objc_catch_block, objc_finally_block): Remove. (objc_catch_prefix, objc_catch_clause, objc_opt_catch_list): New. (objc_try_catch_clause, objc_finally_clause): New. (objc_try_catch_stmt): Rewrite. * c-tree.h (c_eh_initialized_p): Declare. * c-opt (fobjc-sjlj-exceptions): New. * except.c (output_function_exception_table): Don't call cgraph on non-decls. * objc/objc-act.c (UTAG_EXCDATA_VAR, UTAG_CAUGHTEXC_VAR, UTAG_RETHROWEXC_VAR, UTAG_EVALONCE_VAR, struct val_stack, catch_count_stack, exc_binding_stack, if_nesting_count, blk_nesting_count, objc_enter_block, objc_exit_block, objc_declare_variable, val_stack_push, val_stack_pop, objc_build_try_enter_fragment, objc_build_extract_expr, objc_build_try_exit_fragment, objc_build_extract_fragment, objc_build_try_prologue, objc_build_try_epilogue, objc_build_catch_stmt, objc_build_catch_epilogue, objc_build_finally_prologue, objc_build_finally_epilogue, objc_build_try_catch_finally_stmt, objc_build_synchronized_prologue, objc_build_synchronized_epilogue): Remove. (objc_create_temporary_var, struct objc_try_context, cur_try_context, objc_eh_runtime_type, objc_init_exceptions, objc_build_exc_ptr, next_sjlj_build_try_exit, next_sjlj_build_enter_and_setjmp, next_sjlj_build_exc_extract, next_sjlj_build_catch_list, next_sjlj_build_try_catch_finally, objc_begin_try_stmt, objc_begin_catch_clause, objc_finish_catch_clause, objc_build_finally_clause, objc_finish_try_stmt, objc_build_synchronized): New. (objc_is_object_id, objc_is_class_id): New. (objc_comptypes): Use them. (build_next_objc_exception_stuff): Break NeXT sjlj out from build_objc_exception_stuff. (synth_module_prologue): Update to match. (objc_build_throw_stmt): Use cur_try_context to decide if we're in a @catch. * objc/objc-act.h: Update prototypes. (OCTI_EXCEPTION_BLK_STACK, objc_exception_block_stack): Remove. testsuite/ * objc.dg/sync-1.m: New. * objc.dg/try-catch-1.m: Don't force next runtime. * objc.dg/try-catch-3.m, objc.dg/try-catch-4.m: Likewise. * objc.dg/try-catch-2.m: Likewise. Enable everywhere. Remove shadowed catch clause. * objc.dg/try-catch-5.m: New. From-SVN: r83332
2004-06-14Makefile.in (FLAGS_H): New.Zdenek Dvorak1-1/+8
* Makefile.in (FLAGS_H): New. (flags.h): Replace by FLAGS_H. * c.opt: Document Var, VarExists, Init and Report attributes. * common.opt: Fill the values of the attributes. * diagnostic.c (flag_fatal_errors): Do not define. * except.c (flag_non_call_exceptions): Do not define. * flags.h: Include options.h. Remove declarations conflicting with the automatically defined ones. * opts.c: Remove automatically defined variables. (handle_option): Perform default initialization. (common_handle_option): Do not handle options covered by the default initialization. * opts.h (struct cl_option): Add flag_var, has_set_value and set_value fields. (CL_REPORT): New. * opts.sh: Generate variable declarations, handle CL_REPORT. * toplev.c: Remove automatically defined variables. (f_options): Removed. (print_switch_values): Use cl_options instead of f_options. * toplev.h (version_flag): Declaration removed. From-SVN: r83105
2004-05-22c.opt (Wmissing-include-dirs): New.Ben Elliston1-0/+4
* c.opt (Wmissing-include-dirs): New. * c-opts.c (c_common_handle_option): Pass true for user_supplied_p to add_path () for -I, but false for OPT_idirafter, OPT_iquote and OPT_isystem. Handle case OPT_Wmissing_include_dirs. * c-incpath.h (add_path): Add fourth (bool) argument. * c-incpath.c (add_env_var_paths): Pass false to add_path (). (add_standard_paths): Likewise. (remove_duplicates) [REASON_NOENT]: Warn if -Wmissing-include-dirs is used and the directory was user-supplied via -I. (add_path): Set p->user_supplied_p. Remove duplicated code by using add_cpp_dir_path (). * cpplib.h (struct cpp_options): Add warn_missing_include_dirs. (struct cpp_dir): Add user_supplied_p. * doc/invoke.texi (Warning Options): Document new option. [testsuite] * gcc.dg/cpp/Wmissingdirs.c: New. From-SVN: r82121
2004-05-13Merge tree-ssa-20020619-branch into mainline.Diego Novillo1-4/+0
From-SVN: r81764
2004-05-05invoke.texi (Directory Options): Document -iquote.Mike Stump1-1/+5
* doc/invoke.texi (Directory Options): Document -iquote. * doc/cpp.texi: Likewise. * doc/cppopts.texi: Likewise. * c-opts.c (c_common_missing_argument): Add -iquote processing. (c_common_handle_option): Likewise. * c.opt (iquote): Add. * gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add -iquote. * c-incpath.c (merge_include_chains): Update comment to use -iquote. * c-opts.c (case OPT_I): Deprecate -I- support. * doc/invoke.texi: Likewise. * doc/cpp.texi: Likewise. * doc/cppopts.texi: Likewise. From-SVN: r81521
2004-03-15c-incpath.c, [...]: Update copyright.Kazu Hirata1-1/+1
gcc/ * c-incpath.c, c-incpath.h, c-pch.c, c.opt, cppexp.c, et-forest.h, genattr.c, ggc-none.c, hosthooks-def.h, hosthooks.h, params.h, ra-colorize.c, web.c, config/darwin-c.c, config/alpha/freebsd.h, config/arm/pe.c, config/avr/avr-protos.h, config/avr/avr.md, config/fr30/fr30-protos.h, config/fr30/fr30.md, config/h8300/fixunssfsi.c, config/i386/darwin.h, config/i386/freebsd.h, config/i386/freebsd64.h, config/ia64/hpux.h, config/ia64/unwind-ia64.c, config/ip2k/libgcc.S, config/m32r/xm-m32r.h, config/mmix/mmix-modes.def, config/ns32k/netbsd.h, config/ns32k/ns32k.md, config/pa/pa64-hpux.h, config/pa/pa64-regs.h, config/rs6000/aix41.h, config/rs6000/aix43.h, config/rs6000/host-darwin.c, config/sparc/aout.h, config/sparc/freebsd.h, config/sparc/litecoff.h, config/vax/vax-protos.h, doc/hostconfig.texi, doc/include/gcc-common.texi: Update copyright. gcc/cp/ * cp-lang.c, ptree.c: Update copyright. From-SVN: r79506
2004-03-04Add framework support for darwin.Mike Stump1-0/+4
* c-incpath.c: Include target.h and machmode.h. (add_path): Use a consistent style for cpp_dir. Initialize p->construct to 0. (add_cpp_dir_path): New. (register_include_chains): Add use of extra_includes callback. (hook_void_int): Add. (target_c_incpath): Add. * c-incpath.h (add_cpp_dir_path): New. (target_c_incpath_s): Add. (target_c_incpath): Add. (C_INCPATH_INIT): Add. * c-opts.c (c_common_missing_argument, c_common_handle_option): Add -F argument processing. * c.opt: Add -F argument processing. * gcc.c (trad_capable_cpp): Add -F argument processing. * cppfiles.c (find_file_in_dir): Update to use construct callback. (search_path_exhausted, cpp_get_path, cpp_get_buffer, cpp_get_prev): New. (_cpp_find_file): Use search_path_exhausted. (make_cpp_dir): Initialize construct to 0. * cpplib.h (missing_header_cb cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New. (cpp_callbacks): Add missing_header (cpp_dir): Add construct. * target-def.h: (TARGET_OPTF): New. * hooks.c (hook_void_int, hook_void_charptr): Add. * hooks.h (hook_void_int, hook_void_charptr): Add. * Makefile.in (c-incpath.o) : Add $(TARGET_H) and $(MACHMODE_H) dependencies. * doc/invoke.texi (Darwin Options): Document -F. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Add. (TARGET_OPTF): Add. * fix-header.c (target_c_incpath): Add. * config/darwin-c.c: Add c-incpath.h include. (using_frameworks, find_subframework_file, find_subframework_header, add_system_framework_path, frameworks_in_use, num_frameworks, max_frameworks, add_framework, find_framework, struct framework_header, framework_header_dirs, framework_construct_pathname, find_subframework_file, add_system_framework_path, add_framework_path, framework_defaults, darwin_register_frameworks, find_subframework_header): Add. * config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New. (TARGET_OPTION_TRANSLATE_TABLE): Add -framework support. (CPP_SPEC): Add __APPLE_CC__ support. * t-darwin (darwin-c.o): Add c-incpath.h dependency. From-SVN: r78875
2004-02-19c-opts.c (warn_variadic_macros): New.Richard Henderson1-0/+4
* c-opts.c (warn_variadic_macros): New. (c_common_handle_option): Set it. (sanitize_cpp_opts): Copy it to cpp_opts. * c.opt (Wvariadic-macros): New. * cpplib.h (struct cpp_options): Add warn_variadic_macros. * cppinit.c (cpp_create_reader): Initialize it. * cppmacro.c (parse_params): Check it. From-SVN: r78125
2004-02-17re PR c++/11326 (C++ IA64 ABI: 3.1.4: sometimes pointer to temporary return ↵Mark Mitchell1-3/+0
value is implicit first parameter preceding "this") PR c++/11326 * c-common.c (flag_abi_version): Remove. * c-common.h (flag_abi_version): Likewise. * c-opts.c (c_common_handle_option): Remove OPT_fabi_version case. * c.opt (fabi-version): Remove. * calls.c (expand_call): Always pass a function type to struct_value_rtx. Use convert_memory_address. * common.opt (fabi-version): Add it. * flags.h (flag_abi_version): Likewise. (abi_version_at_least): New macro. * opts.c (common_handle_option): Add OPT_fabi_version. * toplev.c (flag_abi_version): Define it. * config/ia64/ia64.c (ia64_struct_retval_addr_is_first_parm_p): New function. (ia64_output_mi_thunk): Use it. (ia64_struct_value_rtx): Likewise. PR c++/11326 * cp-tree.h (abi_version_at_least): Remove. * mangle.c: Include flags.h. PR c++/11326 * g++.dg/abi/structret1.C: New test. From-SVN: r77968
2004-02-02[multiple changes]Eric Christopher1-0/+5
2004-02-02 Eric Christopher <echristo@redhat.com> Zack Weinberg <zack@codesourcery.com> * c-opts.c (c_common_handle_option): Add -finput-charset. * c.opt: Ditto. * cppcharset.c (one_iso88591_to_utf8): Remove. (convert_iso88591_utf8): Ditto. (conversion_tab): Remove 8859-1 converter. (_cpp_input_to_utf8): Remove. (_cpp_init_iconv_buffer): Ditto. (_cpp_close_iconv_buffer): Ditto. (_cpp_convert_input): New function. (_cpp_default_encoding): Ditto. * cpphash.h: Add/remove prototypes for above. * cppfiles.c (read_file_guts): Use _cpp_convert_input. * cppinit.c (cpp_create_reader): Use _cpp_default_encoding for narrow execution and input character sets. * cpplib.c (cpp_push_buffer): Delete uses of removed functions. * doc/cppopts.texi: Document -finput-charset. 2004-02-02 Eric Christopher <echristo@redhat.com> Zack Weinberg <zack@codesourcery.com> * gcc.c-torture/execute/wchar_t-1.c: Add -finput-charset. 2004-01-29 Eric Christopher <echristo@redhat.com> Zack Weinberg <zack@codesourcery.com> * testsuite/22_locale/collate/compare/wchar_t/2.cc: Remove xfail. Use -finput-charset. * testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc: Ditto. * testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc: Ditto * testsuite/22_locale/collate/hash/wchar_t/2.cc: Ditto. * testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc: Ditto. * testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc: Ditto. * testsuite/22_locale/collate/transform/wchar_t/2.cc: Ditto. * testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc: Ditto. * testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc: Ditto. From-SVN: r77136
2003-09-25MERGE OF objc-improvements-branch into MAINLINE.Ziemowit Laski1-1/+17
2003-09-24 Ziemowit Laski <zlaski@apple.com> MERGE OF objc-improvements-branch into MAINLINE. See 'gcc/ChangeLog' and 'gcc/testsuite/ChangeLog' for the gory details. From-SVN: r71748
2003-09-15invoke.texi (Warning Options): Describe -Wold-style-definition.Andreas Jaeger1-0/+4
2003-09-15 Andreas Jaeger <aj@suse.de> Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * doc/invoke.texi (Warning Options): Describe -Wold-style-definition. * c-opts.c (c_common_handle_option): Handle OPT_Wold_style_definition. * c-parse.in: Warn about old-style parameter definition. * c-common.c: Define warn_old_style_defintion. * c-common.h: Declare it. * c.opt: Add Wold-style-defintion. testsuite: 2003-09-15 Andreas Jaeger <aj@suse.de> * gcc.dg/Wold-style-definition-1.c: New test. From-SVN: r71400
2003-08-19PR c++/10538, PR c/5582Andrew Pinski1-0/+4
ChangeLog: * langhooks-def.h (lhd_decl_uninit): Declare. (LANG_HOOKS_DECL_UNINIT): New macro. (LANG_HOOKS_INITIALIZER): Adjust. * langhooks.h (struct lang_hooks): Add new field decl_uninit. * langhooks.c (lhd_decl_uninit): Define. * c-common.c (c_decl_uninit_1): New function. (c_decl_uninit): New function. (warn_init_self): Define. * c-common.h (c_decl_uninit): Declare. (warn_init_self): Declare. * c.opt: Introduce -Winit-self. * c-opts.c (c_common_handle_options): Set warn_init_self. * c-lang.c (LANG_HOOKS_DECL_UNINIT): Define. * objc/objc-lang.c (LANG_HOOKS_DECL_UNINIT): Define. * function.c (uninitialized_vars_warning): Call the language hook. * doc/invoke.texi: Document -Winit-self. cp/ChangeLog: * cp/cp-lang.c (LANG_HOOKS_DECL_UNINIT): Define. testsuite: * gcc.dg/uninit-D.c: New Test. * gcc.dg/uninit-E.c: New Test. * gcc.dg/uninit-F.c: New Test. * gcc.dg/uninit-G.c: New Test. From-SVN: r70574
2003-08-05c.opt: Introduce -fworking-directory.Alexandre Oliva1-0/+4
* c.opt: Introduce -fworking-directory. * doc/cpp.texi, doc/invoke.texi, doc/cppopts.texi: Document it. * c-common.h (flag_working_directory): Declare. * c-common.c (flag_working_directory): Define. * c-opts.c (c_common_handle_options): Set it. (sanitize_cpp_opts): Set... * cpplib.h (struct cpp_options): ... working_directory option. (struct cpp_callbacks): Add dir_change. * cppinit.c (read_original_filename): Call... (read_original_directory): New. Look for # 1 "directory//" and process it. (cpp_read_main_file): Call dir_change callback if working_directory option is set. * gcc.c (cpp_unique_options): Pass -g*. * c-lex.c (cb_dir_change): New. (init_c_lex): Set dir_change callback. * toplev.c (src_pwd): New static variable. (set_src_pwd, get_src_pwd): New functions. * toplev.h (get_src_pwd, set_src_pwd): Declare. * dbxout.c (dbxout_init): Call get_src_pwd() instead of getpwd(). * dwarf2out.c (gen_compile_unit_die): Likewise. * dwarfout.c (output_compile_unit_die, dwarfout_init): Likewise. From-SVN: r70189
2003-08-01Makefile.in: Refine dependencies.Neil Booth1-1/+1
* Makefile.in: Refine dependencies. * c-opts.c (c_common_handle_option): Do nothing for -Wimport. * c.opt: Update help for -Wimport. * cppfiles.c: Include hashtab.h. Update comments. (stack_file): Read the file before updating dependencies. (once_only_file_p): Be smarter about marking once-only files. (_cpp_mark_file_once_only): Correct the check for existence on the list. (open_file_failed): Use name not path, which is NULL. * cpphash.h: Don't include hashtab.h. (struct _cpp_file): Remove. (struct cpp_reader): Update. * cppinit.c (cpp_create_reader): Don't initialize warn_import. * cpplib.h (struct cpp_options): Remove warn_import. (cpp_simplify_path): Remove. From-SVN: r70045
2003-07-28c-parse.in (lineno_stmt_decl_or_labels_ending_decl): Also warn when ↵Hans-Peter Nilsson1-0/+4
warn_declaration_after_statement. * c-parse.in (lineno_stmt_decl_or_labels_ending_decl): Also warn when warn_declaration_after_statement. Call pedwarn_c90, not pedwarn. Correct message: it's "ISO C90", not "ISO C89". * c-common.c (warn_declaration_after_statement): Define. * c-common.h (warn_declaration_after_statement): Declare. * c.opt (Wdeclaration-after-statement): New. * c-errors.c (pedwarn_c90): New function. * c-opts.c (c_common_handle_option) <case OPT_Wdeclaration_after_statement>: New. * c-tree.h (pedwarn_c90): Declare. * doc/invoke.texi (Option Summary): Document -Wdeclaration-after-statement. (Warning Options): Ditto. Co-Authored-By: Michael Culbertson <Michael.J.Culbertson@wheaton.edu> From-SVN: r69899
2003-07-17c.opt: Document Uncodumented; use it.Neil Booth1-6/+15
* c.opt: Document Uncodumented; use it. Document ObjC options. * opts.c (print_filtered_help): Skip undocumented switches. * opts.h (CL_UNDOCUMENTED): New. * opts.sh: Handle Undocumented. * toplev.c (documented_lang_options): Prevent its becoming empty. f: * lang-options.h: Remove. * lang.opt: Document most options. objc: * lang-options.h: Remove. From-SVN: r69494
2003-07-16c.opt: Document more options.Neil Booth1-1/+40
* c.opt: Document more options. cp: * lang-options.h: Remove. From-SVN: r69477
2003-07-15c.opt: Document more options.Neil Booth1-2/+47
* c.opt: Document more options. * toplev.c (documented_lang_options): Remove all local help strings. treelang: * lang-options.h: Remove. * lang.opt: Document some options. Remove --help. * tree1.c (treelang_handle_option): Remove OPT__help case. From-SVN: r69423
2003-07-15c-opts.c (print_help): Remove.Neil Booth1-4/+68
* c-opts.c (print_help): Remove. (c_common_handle_option): Don't handle --help. * c.opt: Document some options. (--help): Remove. * opts.c (print_filtered_help): New. (print_help): Use it. From-SVN: r69383
2003-07-08Makefile.in: Update.Neil Booth1-0/+8
* Makefile.in: Update. * c-opts.c (c_common_handle_option): opt_text now contains the '-'. * c.opt: Update documentation. * common.opt: Add some help text. * opts.c: Include intl.h. (wrap_help, print_help): New. (find_opt, handle_option, common_handle_option): opt_text now contains the '-'. Use print_help to output help. * opts.h (struct cl_option): New member "help". * opts.sh: Update to handle help text output and to prepend options with '-'. * toplev.c (display_help): Remove some help text. From-SVN: r69068
2003-07-05cpplib.h (CPP_AT_NAME, [...]): New token types.Zack Weinberg1-0/+6
* cpplib.h (CPP_AT_NAME, CPP_OBJC_STRING): New token types. (struct cpp_options): Add narrow_charset, wide_charset, bytes_big_endian fields. Remove EBCDIC field. (cpp_init_iconv, cpp_interpret_string): New external interfaces. * cpphash.h: Include <iconv.h> if we have it, otherwise provide a dummy definition of iconv_t. (struct cpp_reader): Add narrow_cset_desc and wide_cset_desc fields. (_cpp_valid_ucn): Update prototype. (_cpp_destroy_iconv): New prototype. * doc/cpp.texi: Document character set handling. * doc/cppopts.texi: Document -fexec-charset= and -fexec-wide-charset=. * doc/extend.texi: Delete entire section on multiline strings. Rewrite section on __FUNCTION__ etc now that these are variables in C. * cppucnid.tab, cppucnid.pl: New files. * cppucnid.h: New generated file. * cppcharset.c: Include cppucnid.h. Lots of commentary added. (iconv_open, iconv, iconv_close): Provide dummy definitions if !HAVE_ICONV. (SOURCE_CHARSET, struct strbuf, init_iconv_desc, cpp_init_iconv, _cpp_destroy_iconv, convert_cset, width_to_mask, convert_ucn, emit_numeric_escape, convert_hex, convert_oct, convert_escape, cpp_interpret_string, narrow_str_to_charconst, wide_str_to_charconst): New. (ucn_valid_in_identifier): Use a binary search through the ucnranges table defined in cppucnid.h, not a long chain of if statements. (_cpp_valid_ucn): Add a limit pointer. Downgrade "universal character names are only valid in C++ and C99" to a warning. Issue the "meaning of \[uU] is different in traditional C" warning here. Take care not to let iconv see an invalid UCS value if we get a malformed UCN. Issue an error if we don't have iconv. (cpp_interpret_charconst): Moved here from cpplex.c. Use cpp_interpret_string to do the heavy lifting. * cppinit.c (cpp_create_reader): Initialize bytes_big_endian, narrow_charset, wide_charset fields of options structure. (cpp_destroy): Call _cpp_destroy_iconv. * cpplex.c (forms_identifier_p): Adjust call to _cpp_valid_ucn. (maybe_read_ucn, hex_digit_value, cpp_parse_escape): Delete. (cpp_interpret_charconst): Moved to cppcharset.c. * cpplib.c (dequote_string): Delete. (interpret_string_notranslate): New. (do_line, do_linemarker): Use interpret_string_notranslate. * Makefile.in (cppcharset.o): Depend on cppucnid.h. * c-common.c (fname_string, combine_strings): Delete. * c-common.h (fname_string, combine_strings): Delete prototypes. * c-lex.c (ignore_escape_flag): Delete. (cb_ident): Use cpp_interpret_string, not lex_string. (get_nonpadding_token): New function. (c_lex): Handle Objective-C @-prefixed identifiers and strings here. Adjust calls to lex_string. Don't write *value twice. (lex_string): Now handles string constant concatenation. Most of the work handed off to cpp_interpret_string. Call fix_string_type here. * c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): Replace with FUNC_NAME, throughout. (OBJC_STRING): New token type. (primary:STRING): No need to call fix_string_type here. (primary:objc_string): Make that OBJC_STRING. (objc_string nonterminal): Delete. (yylexname): Delete code to handle fake string constants. (yylexstring): Delete entirely. (_yylex): Handle CPP_AT_NAME and CPP_OBJC_STRING. No need to handle CPP_ATSIGN. * c.opt (-fexec-charset=, -fwide-exec-charset=): New options. * c-opts.c (missing_arg, c_common_handle_option): Handle OPT_fexec_charset_ and OPT_fwide_exec_charset_. (c_common_init): Set cpp_opts->bytes_big_endian, not cpp_opts->EBCDIC. Call cpp_init_iconv. (print_help): Document -fexec-charset= and -fexec-wide-charset=. (TARGET_EBCDIC): Delete default definition. * objc/objc-act.c (build_objc_string_object): No need to handle string constant concatenation. cp: * parser.c (cp_lexer_read_token): No need to handle string constant concatenation. testsuite: * gcc.c-torture/execute/wchar_t-1.x: New file; XFAIL wchar_t-1.c everywhere. * gcc.dg/concat.c: Concatenation of string constants with __FUNCTION__ / __PRETTY_FUNCTION__ is now a hard error. * gcc.dg/wtr-strcat-1.c: Loosen dg-warning regexp. * gcc.dg/cpp/escape-2.c: Use wide character constants where necessary to avoid multi-character character constant warning. * gcc.dg/cpp/escape.c: Likewise. * gcc.dg/cpp/ucs.c: Likewise. Remove backslashes from dg-bogus comments, as they confuse Tcl. Fix a typo. libstdc++-v3: * testsuite/22_locale/collate/compare/wchar_t/2.cc * testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc * testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc * testsuite/22_locale/collate/hash/wchar_t/2.cc * testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc * testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc * testsuite/22_locale/collate/transform/wchar_t/2.cc * testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc * testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc: XFAIL on all targets. From-SVN: r68952
2003-06-16c-opts.c (c_common_handle_option): s/on/value/.Neil Booth1-4/+8
* c-opts.c (c_common_handle_option): s/on/value/. (OPT_fabi_version_, OPT_ftabstop_, OPT_ftemplate_depth_): Use value directly rather than converting the argument. * c.opt: Update docs. Use UInteger where appropriate. * common.opt: Use UInteger where appropriate. * opts.c (integral_argument): New. (handle_argument): Handle integral arguments, and optional joined arguments. (common_handle_option): Update. * opts.h (CL_MISSING_OK, CL_UINTEGER): New. * opts.sh: Handle JoinedOrMissing and UInteger flags. java: * lang.c (java_handle_option): Special-casing of optional joined arguments no longer needed. * lang.opt: Update switches that take optional argument. From-SVN: r67999
2003-06-15c-opts.c (lang_flags): Update for new spelling of flags.Neil Booth1-4/+16
* c-opts.c (lang_flags): Update for new spelling of flags. (write_langs): Similarly. * c.opt: Specify languages. * opts.h: Remove languages. * opts.sh: Recognise front-end defined languages. ada: * lang.opt: Declare Ada. * misc.c (gnat_init_options): Update. doc: * sourcebuild.texi: Update. f: * lang.opt: Declare F77. java: * lang.opt: Declare Java. * lang.c (java_init_options): Update. treelang: * lang.opt: Declare Treelang. Update. * tree1.c (treelang_init_options): Update. From-SVN: r67976
2003-06-02c-opts.c (CL_REJECT_NEGATIVE): New.Neil Booth1-4/+6
* c-opts.c (CL_REJECT_NEGATIVE): New. (c_common_decode_option): Update to use it. * c.opt: Update documentation; use RejectNegative. * opts.sh: Handle RejectNegative. From-SVN: r67325
2003-06-01Makefile.in (c-options.c, [...]): Parallel make safe.Neil Booth1-0/+2
* Makefile.in (c-options.c, c-options.h): Parallel make safe. * c.opt: End in blank line. * opts.sh: Take AWK from environment if available; use C locale. From-SVN: r67305
2003-05-31Makefile.in (c-opts.o, [...]): Update dependencies.Neil Booth1-0/+600
* Makefile.in (c-opts.o, c-options.h): Update dependencies. * c-opts.c: Include c-options.h and c-options.c. (CL_C_ONLY, CL_OBJC_ONLY, CL_CXX_ONLY, CL_OBJCXX_ONLY): Rename CL_C, CL_OBJC, CL_CXX, CL_OBJCXX. (CL_ARG, CL_ALL, COMMAND_LINE_OPTIONS, struct cl_option, OPT, opt_comp): Remove. (missing_arg, c_common_init_options, c_common_decode_option, write_langs): Update for macro redefinitions and enumeration name changes. * c.opt, opts.sh: New files. * doc/passes.texi: Update. From-SVN: r67278