Commit Graph

3 Commits

Author SHA1 Message Date
Zack Weinberg 3c6e6fbf11 c-decl.c (duplicate_decls): Break apart into...
* c-decl.c (duplicate_decls): Break apart into...
	(diagnose_arglist_conflict, validate_proto_after_old_defn)
	(locate_old_defn, diagnose_mismatched_decls, merge_decls):
	... these new functions.  Restructure for comprehensibility.
	Remove various archaic special cases.  Always report the
	location of the previous declaration when a diagnostic is issued.
	(redeclaration_error_message): Fold into diagnose_mismatched_decls.
	(match_builtin_function_types): Delete unnecessary forward declaration.
testsuite:
	* gcc.dg/Wshadow-1.c, gcc.dg/attr-noinline.c, gcc.dg/decl3.c
	* gcc.dg/redecl-1.c, gcc.dg/visibility-7.c, gcc.dg/wtr-static-1.c
	* gcc.dg/noncompile/20020220-1.c, objc.dg/method-1.m:
	Update dg-error regexps.

From-SVN: r75667
2004-01-11 01:18:58 +00:00
Jason Merrill 5ce89b2ef0 c-decl.c (finish_function): Warn about a non-void function with no return statement and no abnormal exit.
* c-decl.c (finish_function): Warn about a non-void function with
        no return statement and no abnormal exit.
        (current_function_returns_abnormally): New variable.
        (start_function): Clear it.
        (struct c_language_function): Add returns_abnormally.
        (push_c_function_context): Save it.
        (pop_c_function_context): Restore it.
        (builtin_function): Set TREE_THIS_VOLATILE on return fns.
        (grokdeclarator): Set C_FUNCTION_IMPLICIT_INT on functions without
        an explicit return type.
        * c-tree.h: Declare current_function_returns_abnormally.
        (C_FUNCTION_IMPLICIT_INT): New macro.
        * c-typeck.c (build_function_call): Set it.
        (c_expand_return): Set current_function_returns_value even if the
        value is erroneous.

From-SVN: r49551
2002-02-06 15:40:18 -05:00
Alexandre Oliva c8202d4cbe attr-noinline.c, [...]: New tests.
* gcc.dg/attr-noinline.c, gcc.dg/attr-used.c: New tests.
* gcc.dg/attr-invalid.c: Likewise.

From-SVN: r46335
2001-10-18 18:29:25 +00:00