[LLVMbugs] [Bug 7116] New: generated C code is not valid C code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 11 12:08:41 PDT 2010


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

           Summary: generated C code is not valid C code
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: C
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ich at az2000.de
                CC: llvmbugs at cs.uiuc.edu


93-018:build-llvm-bitcode az$ ~/Programmierung/CppIDE/llvm-src/Debug/bin/clang
test.optim.o.cbe.c 
test.optim.o.cbe.c:159:1: error: 'main' must return 'int'
unsigned int main(void);
^
test.optim.o.cbe.c:202:1: error: 'main' must return 'int'
unsigned int main(void) {
^
2 errors generated.


Also not by clang++:

93-018:build-llvm-bitcode az$
~/Programmierung/CppIDE/llvm-src/Debug/bin/clang++ test.optim.o.cbe.c 
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is
deprecated
test.optim.o.cbe.c:159:1: error: 'main' must return 'int'
unsigned int main(void);
^
test.optim.o.cbe.c:173:58: error: redefinition of '_ZStL8__ioinit'
static struct l_class_OC_std_KD__KD_ios_base_KD__KD_Init _ZStL8__ioinit;
                                                         ^
test.optim.o.cbe.c:168:58: note: previous definition is here
static struct l_class_OC_std_KD__KD_ios_base_KD__KD_Init _ZStL8__ioinit;
                                                         ^
test.optim.o.cbe.c:174:26: error: redefinition of '_OC_str'
static struct l_unnamed2 _OC_str = { "Hello World" };
                         ^
test.optim.o.cbe.c:169:26: note: previous definition is here
static struct l_unnamed2 _OC_str;
                         ^
test.optim.o.cbe.c:202:1: error: 'main' must return 'int'
unsigned int main(void) {
^
4 errors generated.


GCC only gives a warning about it:

93-018:build-llvm-bitcode az$ gcc test.optim.o.cbe.c /usr/lib/libstdc++.6.dylib 
test.optim.o.cbe.c: In function ‘main’:
test.optim.o.cbe.c:202: warning: return type of ‘main’ is not ‘int’

-- 
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