xcode 16.3

196 views
Skip to first unread message

David Connet

unread,
Apr 3, 2025, 4:46:40 PMApr 3
to wx-dev
My xcode just updated to 16.3 (not sure what it was before that). I'm
trying to compile the released 3.2.7 and zlib is exploding (3.2.7 did
compile with the previous xcode that was installed.)

This is on Sequoia, xcode SDK is 15.4, and I'm using make.

> ../configure  --disable-debug_flag --disable-compat28
--disable-compat30 --enable-unicode  --with-cxx=17 --disable-sys-libs
--without-libiconv --without-liblzma --disable-mediactrl
--disable-shared --disable-nativedvc --without-libcurl --with-osx
--with-macosx-version-min=10.13
--with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
--enable-macosx_arch=x86_64,arm64
(That's for the fat release build)

It's complaining about OS_CODE being redefined in zutil.h - first
defined on line 141, then again on line 170.

141: #if defined(MACOS) || defined(TARGET_OS_MAC)
169: #ifdef __APPLE__

There's also errors about fdopen, NULL, and a bunch of warnings of "a
function definition without a prototype is deprecated ..."

Dave

David Connet

unread,
Apr 3, 2025, 5:17:03 PMApr 3
to wx-dev
FYI: The same build works on the current dev branch.

Dave

Vadim Zeitlin

unread,
Apr 3, 2025, 6:27:58 PMApr 3
to wx-...@googlegroups.com
On Thu, 3 Apr 2025 13:46:32 -0700 David Connet wrote:

DC> My xcode just updated to 16.3 (not sure what it was before that). I'm
DC> trying to compile the released 3.2.7 and zlib is exploding (3.2.7 did
DC> compile with the previous xcode that was installed.)

How curious. Does this happen only in the Universal build or in a "normal"
build too?

DC> This is on Sequoia, xcode SDK is 15.4, and I'm using make.
DC>
DC> > ../configure  --disable-debug_flag --disable-compat28
DC> --disable-compat30 --enable-unicode  --with-cxx=17 --disable-sys-libs
DC> --without-libiconv --without-liblzma --disable-mediactrl
DC> --disable-shared --disable-nativedvc --without-libcurl --with-osx
DC> --with-macosx-version-min=10.13
DC> --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
DC> --enable-macosx_arch=x86_64,arm64
DC> (That's for the fat release build)
DC>
DC> It's complaining about OS_CODE being redefined in zutil.h - first
DC> defined on line 141, then again on line 170.
DC>
DC> 141: #if defined(MACOS) || defined(TARGET_OS_MAC)
DC> 169: #ifdef __APPLE__

I think this is due to TARGET_OS_MAC being defined, which would also
explain why you don't get this error on master, where zlib doesn't have the
second part of the test on the line 141. So removing it should help.

DC> There's also errors about fdopen, NULL, and a bunch of warnings of "a
DC> function definition without a prototype is deprecated ..."

Are these really errors or warnings? Could you please give (part of) the
exact compiler output?

Thanks,
VZ

David Connet

unread,
Apr 3, 2025, 6:39:52 PMApr 3
to wx-...@googlegroups.com
On 4/3/2025 3:27 PM, Vadim Zeitlin wrote:
> Are these really errors or warnings? Could you please give (part of) the
> exact compiler output?
>
> Thanks,
> VZ

After building first time (to get past all the files that compile), this
is the full error log from make:

======

/Users/dconnet/devtools/wx/wxWidgets-3.2.7/build-release-arm/bk-deps gcc
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
-mmacosx-version-min=10.13 -c -o wxzlib_zutil.o
-I/Users/dconnet/devtools/wx/wxWidgets-3.2.7/build-release-arm/lib/wx/include/osx_cocoa-unicode-static-3.2
-I../include -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0  -DNDEBUG -Wall
-Wundef -O2 -arch arm64 -fno-common -dynamic -fPIC -DPIC     
../src/zlib/zutil.c
In file included from ../src/zlib/zutil.c:8:
../src/zlib/zutil.h:170:11: warning: 'OS_CODE' macro redefined
[-Wmacro-redefined]
  170 | #  define OS_CODE 19
      |           ^
../src/zlib/zutil.h:141:11: note: previous definition is here
  141 | #  define OS_CODE  7
      |           ^
In file included from ../src/zlib/zutil.c:10:
In file included from ../src/zlib/gzguts.h:21:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7:
error: expected identifier or '('
  318 | FILE    *fdopen(int, const char *)
__DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
      |          ^
../src/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
  147 | #        define fdopen(fd,mode) NULL /* No fdopen() */
      |                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h:26:16:
note: expanded from macro 'NULL'
   26 | #define NULL ((void*)0)
      |                ^
In file included from ../src/zlib/zutil.c:10:
In file included from ../src/zlib/gzguts.h:21:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7:
error: expected ')'
../src/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
  147 | #        define fdopen(fd,mode) NULL /* No fdopen() */
      |                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h:26:16:
note: expanded from macro 'NULL'
   26 | #define NULL ((void*)0)
      |                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7:
note: to match this '('
../src/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
  147 | #        define fdopen(fd,mode) NULL /* No fdopen() */
      |                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h:26:15:
note: expanded from macro 'NULL'
   26 | #define NULL ((void*)0)
      |               ^
In file included from ../src/zlib/zutil.c:10:
In file included from ../src/zlib/gzguts.h:21:
In file included from
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:61:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7:
error: expected ')'
  318 | FILE    *fdopen(int, const char *)
__DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
      |          ^
../src/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
  147 | #        define fdopen(fd,mode) NULL /* No fdopen() */
      |                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h:26:22:
note: expanded from macro 'NULL'
   26 | #define NULL ((void*)0)
      |                      ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h:318:7:
note: to match this '('
../src/zlib/zutil.h:147:33: note: expanded from macro 'fdopen'
  147 | #        define fdopen(fd,mode) NULL /* No fdopen() */
      |                                 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h:26:14:
note: expanded from macro 'NULL'
   26 | #define NULL ((void*)0)
      |              ^
../src/zlib/zutil.c:135:22: warning: a function definition without a
prototype is deprecated in all versions of C and is not supported in C23
[-Wdeprecated-non-prototype]
  135 | const char * ZEXPORT zError(err)
      |                      ^
../src/zlib/zconf.h:169:33: note: expanded from macro 'zError'
  169 | #  define zError                Z_ADD_PREFIX(zError)
      |                                 ^
../src/zlib/zconf.h:42:30: note: expanded from macro 'Z_ADD_PREFIX'
   42 | #  define Z_ADD_PREFIX(name) ZLIB_CONCAT(Z_PREFIX_, name)
      |                              ^
../src/zlib/zconf.h:36:27: note: expanded from macro 'ZLIB_CONCAT'
   36 | #define ZLIB_CONCAT(x, y) ZLIB_CONCAT2(x, y)
      |                           ^
../src/zlib/zconf.h:35:28: note: expanded from macro 'ZLIB_CONCAT2'
   35 | #define ZLIB_CONCAT2(x, y) x ## y
      |                            ^
<scratch space>:9:1: note: expanded from here
    9 | wx_zlib_zError
      | ^
../src/zlib/zutil.c:307:22: warning: a function definition without a
prototype is deprecated in all versions of C and is not supported in C23
[-Wdeprecated-non-prototype]
  307 | voidpf ZLIB_INTERNAL zcalloc(opaque, items, size)
      |                      ^
../src/zlib/zconf.h:171:35: note: expanded from macro 'zcalloc'
  171 | #    define zcalloc               Z_ADD_PREFIX(zcalloc)
      |                                   ^
../src/zlib/zconf.h:42:30: note: expanded from macro 'Z_ADD_PREFIX'
   42 | #  define Z_ADD_PREFIX(name) ZLIB_CONCAT(Z_PREFIX_, name)
      |                              ^
../src/zlib/zconf.h:36:27: note: expanded from macro 'ZLIB_CONCAT'
   36 | #define ZLIB_CONCAT(x, y) ZLIB_CONCAT2(x, y)
      |                           ^
../src/zlib/zconf.h:35:28: note: expanded from macro 'ZLIB_CONCAT2'
   35 | #define ZLIB_CONCAT2(x, y) x ## y
      |                            ^
<scratch space>:12:1: note: expanded from here
   12 | wx_zlib_zcalloc
      | ^
../src/zlib/zutil.c:317:20: warning: a function definition without a
prototype is deprecated in all versions of C and is not supported in C23
[-Wdeprecated-non-prototype]
  317 | void ZLIB_INTERNAL zcfree(opaque, ptr)
      |                    ^
../src/zlib/zconf.h:172:35: note: expanded from macro 'zcfree'
  172 | #    define zcfree                Z_ADD_PREFIX(zcfree)
      |                                   ^
../src/zlib/zconf.h:42:30: note: expanded from macro 'Z_ADD_PREFIX'
   42 | #  define Z_ADD_PREFIX(name) ZLIB_CONCAT(Z_PREFIX_, name)
      |                              ^
../src/zlib/zconf.h:36:27: note: expanded from macro 'ZLIB_CONCAT'
   36 | #define ZLIB_CONCAT(x, y) ZLIB_CONCAT2(x, y)
      |                           ^
../src/zlib/zconf.h:35:28: note: expanded from macro 'ZLIB_CONCAT2'
   35 | #define ZLIB_CONCAT2(x, y) x ## y
      |                            ^
<scratch space>:17:1: note: expanded from here
   17 | wx_zlib_zcfree
      | ^
4 warnings and 3 errors generated.
make: *** [wxzlib_zutil.o] Error 1

David Connet

unread,
Apr 3, 2025, 6:45:35 PMApr 3
to wx-...@googlegroups.com
On 4/3/2025 3:27 PM, Vadim Zeitlin wrote:
> I think this is due to TARGET_OS_MAC being defined, which would also
> explain why you don't get this error on master, where zlib doesn't have the
> second part of the test on the line 141. So removing it should help.

Weird... Ok, removing that let zlib compile. Now png blows up the a
fatal "'fp.h' not found" (pngpriv.h)

Dave

David Connet

unread,
Apr 3, 2025, 6:47:22 PMApr 3
to wx-...@googlegroups.com
Looks like that may be related to TARGET_OS_MAC also.

Dave

David Connet

unread,
Apr 3, 2025, 7:29:07 PMApr 3
to wx-...@googlegroups.com
Ok, so removing the "defined(TARGET_OS_MAC)" check from:
src/zlib/zutil.h, line 140
src/png/pngpriv.h, line 530

3.2.7 now compiles. (And my program compiled/ran - don't know that I
ever exercise anything in those libs though)

Dave

Vadim Zeitlin

unread,
Apr 4, 2025, 7:15:12 AMApr 4
to wx-...@googlegroups.com
On Thu, 3 Apr 2025 16:29:00 -0700 David Connet wrote:

DC> Ok, so removing the "defined(TARGET_OS_MAC)" check from:
DC> src/zlib/zutil.h, line 140
DC> src/png/pngpriv.h, line 530

Thanks!

I don't know if we can update to zlib 1.3 in 3.2 branch: as usual, the
problem is that I can't even test it with the ancient MSVS versions we
still support there any more.

DC> 3.2.7 now compiles. (And my program compiled/ran - don't know that I
DC> ever exercise anything in those libs though)

If it uses PNG images, it should.

Regards,
VZ
Reply all
Reply to author
Forward
0 new messages