[LLVMbugs] [Bug 15100] New: clang++ failed to compile simple program with int main(int argc, const char_T * argv[])

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 28 18:25:53 PST 2013


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

             Bug #: 15100
           Summary: clang++ failed to compile simple program with int
                    main(int argc, const char_T * argv[])
           Product: clang
           Version: 3.2
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dmarkman at mac.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


clang++ failed to compile the following simple program


#include <iostream>

typedef char char_T;

int main(int argc, const char_T * argv[])
{
        std::cout << "Hello Test World!" << std::endl;
        return 0;
}

it complained
dima_test.cpp:5:5: error: second parameter of 'main' (argument array) must be
of type 'char **'
int main(int argc, const char_T * argv[])

gcc-4.7.1 is fine with that

that is true, that standard defines main function as
int main() or int main(int, char **)

however clang is happy with int main(int, const char **)

so we can see inconsistency, from other hand if clang fails to compile
int main(int, const char **)
then clang will fail to compile
millions of  programs which is definitely unacceptable

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