OSDN Git Service

* c-tree.h (C_DECL_USED, parser_obstack, in_alignof, in_sizeof,
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Sep 2004 01:16:16 +0000 (01:16 +0000)
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Sep 2004 01:16:16 +0000 (01:16 +0000)
commit9823d3a9a666d8459764265abd3b04ead5c3def1
treecafc9cbafbe798461e115c710492d5167b17d34a
parent196bfa93bdbc9ac2c3e3f5104b6774bbbce7c150
* c-tree.h (C_DECL_USED, parser_obstack, in_alignof, in_sizeof,
in_typeof, record_maybe_used_decl, pop_maybe_used,
c_expr_sizeof_expr, c_expr_sizeof_type): New.
* c-decl.c (parser_obstack): New.
(c_init_decl_processing): Initialize parser_obstack.
(c_write_global_declarations_1): Check for used but undefined
static functions.
* c-parse.in (%union): Add otype.
(save_obstack_position): New.
(extdefs): Use it.
(unary_expr): Update in_sizeof and in_alignof.  Use
c_expr_sizeof_expr and c_expr_sizeof_type.
(sizeof): Update in_sizeof.
(alignof): Update in_alignof.
(typeof): Update in_typeof.
(typespec_nonreserved_nonattr): Call pop_maybe_used.
* c-typeck.c (in_alignof, in_sizeof, in_typeof, struct
maybe_used_decl, maybe_used_decls, record_maybe_used_decl,
pop_maybe_used, c_expr_sizeof_expr, c_expr_sizeof_type): New.
(build_external_ref): Set C_DECL_USED or call
record_maybe_used_decl if appropriate.
* toplev.c (check_global_declarations): Check TREE_NO_WARNING.

testsuite:
* gcc.dg/c90-static-1.c, gcc.dg/c99-static-1.c,
gcc.dg/gnu99-static-1.c: New tests.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87216 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/c-decl.c
gcc/c-parse.in
gcc/c-tree.h
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/c90-static-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/c99-static-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/gnu99-static-1.c [new file with mode: 0644]
gcc/toplev.c