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

           Summary: clang rejects ANSI C style prototype + K&R style
                    definition
           Product: clang
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [email protected]


% cat t9.c
void f(char c);
void f(c) char c; { }

% gcc -Wall -c t9.c

% gcc -Wall -pedantic -c t9.c
t9.c: In function ‘f’:
t9.c:2: warning: promoted argument ‘c’ doesn’t match prototype
t9.c:1: warning: prototype declaration

% clang -x c t9.c
t9.c:2:6: error: conflicting types for 'f'
void f(c) char c; { }
     ^
t9.c:1:6: error: previous declaration is here
void f(char c);
     ^
2 diagnostics generated.
zsh: exit 1     clang -x c t9.c


Summary:
- gcc: compiles w/o warnings
- gcc -pedantic: compiles w/ warnings
- clang: error

llvm r56425 / clang r56427 on Mac OS X 10.5.5 (PPC)


-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to