This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11377] fault or warn modifiable static in extern inline definition



------- Comment #5 from geoffk at gcc dot gnu dot org  2006-11-01 04:47 -------
Subject: Bug 11377

Author: geoffk
Date: Wed Nov  1 04:47:30 2006
New Revision: 118356

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118356
Log:
        * c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on
        inline static functions in c99 mode.

        PR 16622
        * doc/extend.texi (Inline): Update.
        * c-tree.h (struct language_function): Remove field 'extern_inline'.
        * c-decl.c (current_extern_inline): Delete.
        (pop_scope): Adjust test for an undefined nested function.
        Add warning about undeclared inline function.
        (diagnose_mismatched_decls): Update comments.  Disallow overriding
        of inline functions in a translation unit in C99.  Allow inline
        declarations in C99 at any time.
        (merge_decls): Boolize variables.  Handle C99 'extern inline'
        semantics.
        (grokdeclarator): Set DECL_EXTERNAL here for functions.  Handle
        C99 inline semantics.
        (start_function): Don't clear current_extern_inline.  Don't set
        DECL_EXTERNAL.
        (c_push_function_context): Don't push current_extern_inline.
        (c_pop_function_context): Don't restore current_extern_inline.

        PR 11377
        * c-typeck.c (build_external_ref): Warn about static variables
        used in extern inline functions.
        * c-decl.c (start_decl): Warn about static variables declared
        in extern inline functions.

Added:
    trunk/gcc/testsuite/gcc.dg/inline-13.c
    trunk/gcc/testsuite/gcc.dg/inline-14.c
    trunk/gcc/testsuite/gcc.dg/inline-15.c
    trunk/gcc/testsuite/gcc.dg/inline-16.c
    trunk/gcc/testsuite/gcc.dg/inline6.c
    trunk/gcc/testsuite/gcc.dg/inline7.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-decl.c
    trunk/gcc/c-tree.h
    trunk/gcc/c-typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/inline-10.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11377


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]