public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35017]  New: [4.3 Regression] PR11377 pedwarns even about valid code
@ 2008-01-29 15:25 jakub at gcc dot gnu dot org
  2008-01-29 15:25 ` [Bug c/35017] " jakub at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-01-29 15:25 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118357 introduced pedwarns
about any static decls in external linkage inline functions, but ISO C99
6.4.7/3
has:
"An inline definition of a function with external linkage shall not contain a
definition of a modifiable object with static storage duration, and shall not
contain a reference to an identifier with internal linkage."
In -std=c99:

inline int foo (void) { static const int c = 6; return c; }

the static variable c isn't modifiable, so the first condition doesn't apply,
and from 6.2.2 I gather c has no linkage rather than internal linkage and so
the other condition doesn't apply either.

In -std=c99:

static const int c = 6;
inline int foo (void) { return c; }

I believe c has internal linkage and thus it is invalid (and therefore
correctly diagnosed by the trunk).


-- 
           Summary: [4.3 Regression] PR11377 pedwarns even about valid code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-01-29 23:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-29 15:25 [Bug c/35017] New: [4.3 Regression] PR11377 pedwarns even about valid code jakub at gcc dot gnu dot org
2008-01-29 15:25 ` [Bug c/35017] " jakub at gcc dot gnu dot org
2008-01-29 15:48 ` rguenth at gcc dot gnu dot org
2008-01-29 16:06 ` jakub at gcc dot gnu dot org
2008-01-29 17:27 ` pinskia at gcc dot gnu dot org
2008-01-29 17:52 ` jakub at gcc dot gnu dot org
2008-01-29 18:00 ` jakub at gcc dot gnu dot org
2008-01-29 19:37 ` jakub at gcc dot gnu dot org
2008-01-29 19:52 ` joseph at codesourcery dot com
2008-01-29 23:46 ` jakub at gcc dot gnu dot org
2008-01-30  0:03 ` jakub at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).