[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Simple failed test on MacOS

From: Rob
Subject: Re: [Tinycc-devel] Simple failed test on MacOS
Date: Wed, 14 Nov 2012 12:49:06 +0000

This is because OSSwapInt16 uses both uint16_t and __uint16_t, neither
of which are declared (via typedefs) beforehand.
Perhaps there's some missing macro to trigger this in the Darwin system headers.

Adding this to the start of your file seems to fix things, anyway:

typedef unsigned short __uint16_t, uint16_t;
typedef unsigned int __uint32_t, uint32_t;
typedef unsigned long __uint64_t, uint64_t;

Although I then get linker errors with printf/_printf.

On 13 November 2012 15:03, Pedro A ARANDA <address@hidden> wrote:
> Hi folks,
> any code including <stdlib.h> will fail in tcc in MacOS
> Example code fail.c:
> #include <stdio.h>
> #include <stdlib.h>
> int main(int argc,char **argv)
> {
>     printf("Hello world!\n");
> }
> Output on the CLI:
> paag:bin paag$ tcc -run fail.c
> In file included from fail.c:2:
> In file included from /usr/include/stdlib.h:65:
> In file included from /usr/include/sys/wait.h:193:
> In file included from /usr/include/machine/endian.h:35:
> In file included from /usr/include/i386/endian.h:99:
> In file included from /usr/include/sys/_endian.h:124:
> /usr/include/libkern/_OSByteOrder.h:99: error: ';' expected (got
> "_OSSwapInt16")
> fail.c will run if you remove the <stdlib.h> inclusion
> Best,
> /PA
> _______________________________________________
> Tinycc-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]