tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] mob is not compiling on osx 10.12


From: Michael Matz
Subject: Re: [Tinycc-devel] mob is not compiling on osx 10.12
Date: Sat, 11 Apr 2020 04:19:11 +0200 (CEST)
User-agent: Alpine 2.21 (LSU 202 2017-01-01)

Hi,

On Sat, 11 Apr 2020, Robert Hölzl wrote:

I tried to build the "mob" branch (commit id df67d86) of TCC on macos (10.12) without success.
I get the following error message when running "make":

...
../tcc -c bt-exe.c -o ../bt-exe.o -B.. -I.. -D_ANSI_SOURCE
In file included from bt-exe.c:6:
In file included from ../tccrun.c:21:
In file included from ../tcc.h:27:
In file included from /usr/include/stdlib.h:63:
In file included from /usr/include/_types.h:27:
In file included from /usr/include/sys/_types.h:32:
/usr/include/sys/cdefs.h:81: warning: #warning "Unsupported compiler detected"
In file included from bt-exe.c:6:
In file included from ../tccrun.c:21:
In file included from ../tcc.h:29:
../include/stdarg.h:19: error: incompatible redefinition of 'va_list'
m

Our stdarg.h has provisions for possibly working with MacOS (via defining a macro that is expected by MacOS headers), but that's only going to work if it's not too late. It might be too late if other standard headers are included before. So, can you try moving the include stdarg.h in tcc.h in front of the other includes? (As in the below patch).

If that works, please push it to mob.


Ciao,
Michael.

diff --git a/tcc.h b/tcc.h
index 82238ce..184a62a 100644
--- a/tcc.h
+++ b/tcc.h
@@ -24,9 +24,9 @@
 #define _GNU_SOURCE
 #include "config.h"

+#include <stdarg.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <stdarg.h>
 #include <string.h>
 #include <errno.h>
 #include <math.h>

reply via email to

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