[LLVMbugs] [Bug 2821] New: clang rejects ANSI C style prototype + K&R style definition
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Mon Sep 22 15:42:32 PDT 2008
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: unassignedbugs at nondot.org
ReportedBy: richard at godbee.net
CC: llvmbugs at cs.uiuc.edu
% 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.
More information about the llvm-bugs
mailing list