tinycc-devel
[Top][All Lists]
Advanced

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

[Tinycc-devel] wchar_t conflict on alpine linux (musl)


From: Cyan Ogilvie
Subject: [Tinycc-devel] wchar_t conflict on alpine linux (musl)
Date: Tue, 8 Aug 2023 17:46:47 +0200

I'm hitting the same issue with conflicting types for wchar_t that Sagar Acharya reported on the 24th of July (before I subscribed to the list so I can't directly reply to the thread).

I'm building on alpine linux, and /usr/include/bits/alltypes.h contains:

#if defined(__NEED_wchar_t) && !defined(__DEFINED_wchar_t)
typedef unsigned wchar_t;
#define __DEFINED_wchar_t
#endif

If I prefix my c code with

#define __DEFINED_wchar_t 1

then everything is fine (using the wchar_t definition from tcc's stddef.h).  I can't really change musl's headers, and it seems like a nasty hack to force the definition of __DEFINED_wchar_t in all my c source files before anything is included (my actual use case involves dynamically generated c code compiled just-in-time from a scripting language, on various architectures and platforms and libc implementations).

What is the right way forward?  It seems like tcc will fail building anything that includes musl's headers as it is currently.

Thanks

Cyan

reply via email to

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