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

Robert Lytton robert at xmos.com
Fri Oct 4 02:29:32 PDT 2013


Hi Richard,
My mistake, checked the wrong library!
newlib uses "typedef signed long int32_t;"
Thus the error is correct.
Robert

________________________________
From: Robert Lytton
Sent: 04 October 2013 10:09
To: Richard Smith
Cc: cfe-dev at cs.uiuc.edu; Richard Osborne
Subject: RE: [cfe-dev] error when using "int32_t main (int32_t argc, char * argv[])"

> The problem is that 'main' is required to take a parameter of type 'int' and return a value of type 'int', and 'int32_t' is not necessarily 'int'.
> The correct solution is to fix the code to use the right types, as you suggested.

Thanks Richard.
This then leads to the question why the code builds without an error if the "--target" is not specified (not checked  permutations).
By the way 'int32_t' is 'int' in this situation.
It would be nice if there was consistency...

Robert


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


More information about the cfe-dev mailing list