This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/22052] New: redefinition of inline function succeeds
- From: "echristo at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jun 2005 19:02:11 -0000
- Subject: [Bug c/22052] New: redefinition of inline function succeeds
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This doesn't error out:
#include <stdio.h>
static inline int foo(void) { return 1; }
static inline int foo(void) { return 0; }
static inline int bar(void) { return foo(); }
int main(void)
{
if (bar())
printf("1\n");
else
printf("0\n");
return 0;
}
It appears to be a problem with inlining since if the inline keyword is removed
it works (well, fails) as expected.
--
Summary: redefinition of inline function succeeds
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: echristo at redhat dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22052