[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnu-libiconv] iconv_allocation_t Conflict with Xcode 15.0
From: |
Bruno Haible |
Subject: |
Re: [bug-gnu-libiconv] iconv_allocation_t Conflict with Xcode 15.0 |
Date: |
Sun, 31 Dec 2023 18:27:39 +0100 |
Hello Okamura-san,
> I'm writing to report a symbol conflict with GNU libiconv that occurs
> when compiling with Xcode 15.0. The system `iconv.h` provided by Xcode
> defines `iconv_allocation_t` in a way that differs from GNU libiconv's
> definition, leading to a compilation error.
>
> Here's how `iconv_allocation_t` is defined in Xcode 15.0's system `iconv.h`:
>
> ```c
> typedef struct {
> void *spaceholder[64];
> } iconv_allocation_t;
> ```
> (Location:
> `/Applications/Xcode_15.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/iconv.h`)
>
> This conflicts with the definition in the GNU libiconv library and
> results in the following compilation error:
>
> ```
> /Users/iceman/projects/xciconv/.build/arm64-apple-macosx/debug/libiconv.framework/Headers/iconv.h:122:13:
> error: '(anonymous struct)::dummy2' from module 'libiconv' is not
> present in the definition of 'iconv_allocation_t' in module
> 'Darwin.POSIX.iconv'
> mbstate_t dummy2;
> ^
> /Applications/Xcode_15.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/include/iconv.h:90:9:
> note: definition has no member 'dummy2'
> typedef struct {
> ^
> ```
How do you manage to include the system's iconv.h and GNU libiconv's iconv.h
in the same compilation unit? Normally, depending on the -I options that are
being passed to the compiler, a #include <iconv.h> should include one or the
other, but not both.
Bruno