[LLVMbugs] [Bug 3441] New: mixing ANSI C declaration and K&R function is sometimes allowed and sometimes not

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Jan 30 05:54:47 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=3441

           Summary: mixing ANSI C declaration and K&R function is sometimes
                    allowed and sometimes not
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: rdivacky at freebsd.org
                CC: llvmbugs at cs.uiuc.edu


sometimes it works, sometimes it doesnt:

lev /tmp$ cat y.c
static int i(int, int);

static int i(j, k)
   int j;
   int k;
{
   return 0;
}
lev /tmp$ ccc y.c
/usr/lib/crt1.o(.text+0x8a): In function `_start':
: undefined reference to `main'
lev /tmp$ cat yy.c
static int i(int, int, char);

static int i(j, k, l)
   int j;
   int k;
   char l;
{
   return 0;
}
lev /tmp$ ccc yy.c
yy.c:3:12: error: conflicting types for 'i'
static int i(j, k, l)
           ^
yy.c:1:12: note: previous declaration is here
static int i(int, int, char);
           ^
2 diagnostics generated.
lev /tmp$ 

there are similar bugs #2412 and #2821, dont know if it's related but it looks
like it is


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list