[cfe-dev] error when using "int32_t main (int32_t argc, char * argv[])"

Robert Lytton robert at xmos.com
Thu Oct 3 03:52:09 PDT 2013


Hi,

I'm trying to get the 'test-suite' running using clang as a cross compiler for XCore.

However I have hit the following problem:

    clang++ -c llvm-test-suite/MultiSource/Applications/ALAC/decode/main.cpp --target=xcore
    llvm-test-suite/MultiSource/Applications/ALAC/decode/main.cpp:72:1: error: 'main' must return 'int'
    int32_t main (int32_t argc, char * argv[])
    ^
    llvm-test-suite/MultiSource/Applications/ALAC/decode/main.cpp:72:9: error: first parameter of 'main' (argument count) must be of type 'int'
    int32_t main (int32_t argc, char * argv[])
            ^
    2 errors generated.


However, running without the " --target=xcore" and all is fine.

The simple solution for me is to change 'int32_t' to 'int' in the two problematic files' main functions viz:
    llvm-test-suite/MultiSource/Applications/ALAC/decode/main.cpp:int32_t main (int32_t argc, char * argv[])
    llvm-test-suite/MultiSource/Applications/ALAC/encode/main.cpp:int32_t main (int32_t argc, char * argv[])
N.B. The use of int32_t is fine in the rest of the file (stdint.h is available).

Does anyone know what the problem is, and what is the correct solution?

Thank you

Robert


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131003/f662274b/attachment.html>


More information about the cfe-dev mailing list