public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/17205] New: Strange behaviour when function prototypes appear inside other functions
@ 2004-08-27  6:14 anton at samba dot org
  2004-08-27  6:16 ` [Bug c/17205] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: anton at samba dot org @ 2004-08-27  6:14 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2004-09-01 22:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-27  6:14 [Bug c/17205] New: Strange behaviour when function prototypes appear inside other functions anton at samba dot org
2004-08-27  6:16 ` [Bug c/17205] " pinskia at gcc dot gnu dot org
2004-08-27  6:17 ` [Bug c/17205] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-08-27  9:44 ` jsm at polyomino dot org dot uk
2004-08-27 13:51 ` geoffk at gcc dot gnu dot org
2004-08-30 22:19 ` cvs-commit at gcc dot gnu dot org
2004-08-30 22:23 ` geoffk at gcc dot gnu dot org
2004-09-01 22:12 ` cvs-commit 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).