[LLVMbugs] [Bug 4720] New: clang should not error on different main

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Aug 14 16:30:59 PDT 2009


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

           Summary: clang should not error on different main
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: OpenBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jsg at openbsd.org
                CC: llvmbugs at cs.uiuc.edu


Recent versions of clang now error on main defined differently,
this is not in keeping with the behaviour of gcc.

clang:
../../../../kern/init_main.c:137:5: error: first argument of 'main' should be
of type 'int'
int     main(void *);
        ^
../../../../kern/init_main.c:184:1: error: first argument of 'main' should be
of type 'int'
main(void *framep)
^

gcc:
../../../../kern/init_main.c:185: warning: first argument of `main' should be
`int'
../../../../kern/init_main.c:185: warning: `main' takes only zero or two
arguments

The gcc warning can be disabled with -Wno-main, clang does not recognise this
option.  With this recent change clang can no longer compile the OpenBSD kernel
and likely other code besides.


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