public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/34735] New: C99 6.7.4/2 is not diagnose
@ 2008-01-11 5:45 pinskia at gcc dot gnu dot org
2008-01-11 6:06 ` [Bug c/34735] C99 6.7.4/3 " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-11 5:45 UTC (permalink / raw)
To: gcc-bugs
This is not rejected:
static int a()
{
return 0;
}
extern int f(void);
inline int f(void)
{
return a();
}
---- CUT ---
This violates C99 6.7.4/2 which says:
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.
--
Summary: C99 6.7.4/2 is not diagnose
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34735
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/34735] C99 6.7.4/3 is not diagnose
2008-01-11 5:45 [Bug c/34735] New: C99 6.7.4/2 is not diagnose pinskia at gcc dot gnu dot org
@ 2008-01-11 6:06 ` pinskia at gcc dot gnu dot org
2008-01-11 9:55 ` rguenth at gcc dot gnu dot org
2008-01-14 1:28 ` geoffk at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-01-11 6:06 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-01-11 05:15 -------
We do reject this though:
static int a()
{
return 0;
}
inline int f(void)
{
return a();
}
extern int f(void);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34735
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/34735] C99 6.7.4/3 is not diagnose
2008-01-11 5:45 [Bug c/34735] New: C99 6.7.4/2 is not diagnose pinskia at gcc dot gnu dot org
2008-01-11 6:06 ` [Bug c/34735] C99 6.7.4/3 " pinskia at gcc dot gnu dot org
@ 2008-01-11 9:55 ` rguenth at gcc dot gnu dot org
2008-01-14 1:28 ` geoffk at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-11 9:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2008-01-11 09:28 -------
Confirmed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-01-11 09:28:29
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34735
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/34735] C99 6.7.4/3 is not diagnose
2008-01-11 5:45 [Bug c/34735] New: C99 6.7.4/2 is not diagnose pinskia at gcc dot gnu dot org
2008-01-11 6:06 ` [Bug c/34735] C99 6.7.4/3 " pinskia at gcc dot gnu dot org
2008-01-11 9:55 ` rguenth at gcc dot gnu dot org
@ 2008-01-14 1:28 ` geoffk at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2008-01-14 1:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from geoffk at gcc dot gnu dot org 2008-01-14 00:55 -------
The quoted paragraph does not apply to the first code example, because an
"inline definition" is defined in paragraph 6 as:
If all of the file scope declarations for a function in a translation
unit include the inline function specifier without extern, then the
definition in that translation unit is an inline definition.
In this case, one of the declarations does not include the inline function
specifier, so it's not an inline definition.
I am unclear on how the standard is supposed to apply to the second example,
but IMO we should give the warning anyway.
--
geoffk at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34735
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-01-14 0:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-11 5:45 [Bug c/34735] New: C99 6.7.4/2 is not diagnose pinskia at gcc dot gnu dot org
2008-01-11 6:06 ` [Bug c/34735] C99 6.7.4/3 " pinskia at gcc dot gnu dot org
2008-01-11 9:55 ` rguenth at gcc dot gnu dot org
2008-01-14 1:28 ` geoffk 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).