This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/17205] New: Strange behaviour when function prototypes appear inside other functions
- From: "anton at samba dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Aug 2004 06:14:55 -0000
- Subject: [Bug c/17205] New: Strange behaviour when function prototypes appear inside other functions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc version 3.5.0 20040827 (experimental)
A 2.6 kernel compilation encountered a link failure. The following sequence
shows how things fail if a function protoype appears inside another function:
#define BROKE
#ifndef BROKE
static void foo(void);
#endif
int main()
{
#ifdef BROKE
static void foo(void);
#endif
foo();
}
static void foo(void)
{
printf("bar\n");
}
define BROKE and foo disappears completely, undefine it and it works as
expected. To be honest Im not even sure this is valid C.
--
Summary: Strange behaviour when function prototypes appear inside
other functions
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: anton at samba dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17205