Build failure with Xcode 14.X / macOS Ventura
Hello
I have encountered many build errors while building waffle 1.7.2 on macOS Ventura:
[ 97%] Built target wcore_attrib_list_unittest
[ 97%] Built target wcore_error_unittest
[ 97%] Built target wcore_config_attrs_unittest
In file included from /tmp/waffle-20230629-12928-1te5p17/waffle-1.7.2/examples/gl_basic.c:55:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:62:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h:26:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h:22:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/ppd.h:24:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/cups.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/ipp.h:18:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/http.h:39:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:86:2: error: unknown type name 'u_int'
u_int ip_hl:4, /* header length */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:90:2: error: unknown type name 'u_int'
u_int ip_v:4, /* version */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:90:10: error: duplicate member 'ip_v'
u_int ip_v:4, /* version */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:87:6: note: previous declaration is here
ip_v:4; /* version */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:91:6: error: duplicate member 'ip_hl'
ip_hl:4; /* header length */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:86:10: note: previous declaration is here
u_int ip_hl:4, /* header length */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:94:2: error: unknown type name 'u_char'; did you mean 'char'?
u_char ip_tos; /* type of service */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:95:2: error: unknown type name 'u_short'; did you mean 'n_short'?
u_short ip_len; /* total length */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/in_systm.h:84:20: note: 'n_short' declared here
typedef __uint16_t n_short; /* short as received from the net */
^
In file included from /tmp/waffle-20230629-12928-1te5p17/waffle-1.7.2/examples/gl_basic.c:55:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:62:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h:26:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h:22:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/ppd.h:24:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/cups.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/ipp.h:18:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/http.h:39:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:96:2: error: unknown type name 'u_short'; did you mean 'n_short'?
u_short ip_id; /* identification */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/in_systm.h:84:20: note: 'n_short' declared here
typedef __uint16_t n_short; /* short as received from the net */
^
In file included from /tmp/waffle-20230629-12928-1te5p17/waffle-1.7.2/examples/gl_basic.c:55:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:62:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h:26:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h:22:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/ppd.h:24:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/cups.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/ipp.h:18:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/http.h:39:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:97:2: error: unknown type name 'u_short'; did you mean 'n_short'?
u_short ip_off; /* fragment offset field */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/in_systm.h:84:20: note: 'n_short' declared here
typedef __uint16_t n_short; /* short as received from the net */
^
In file included from /tmp/waffle-20230629-12928-1te5p17/waffle-1.7.2/examples/gl_basic.c:55:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:62:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h:26:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h:22:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/ppd.h:24:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/cups.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/ipp.h:18:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/http.h:39:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:102:2: error: unknown type name 'u_char'; did you mean 'char'?
u_char ip_ttl; /* time to live */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:103:2: error: unknown type name 'u_char'; did you mean 'char'?
u_char ip_p; /* protocol */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:104:2: error: unknown type name 'u_short'; did you mean 'n_short'?
u_short ip_sum; /* checksum */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/in_systm.h:84:20: note: 'n_short' declared here
typedef __uint16_t n_short; /* short as received from the net */
^
In file included from /tmp/waffle-20230629-12928-1te5p17/waffle-1.7.2/examples/gl_basic.c:55:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:62:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h:26:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h:22:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/ppd.h:24:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/cups.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/ipp.h:18:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/cups/http.h:39:
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:189:2: error: unknown type name 'u_char'; did you mean 'char'?
u_char ipt_code; /* IPOPT_TS */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:190:2: error: unknown type name 'u_char'; did you mean 'char'?
u_char ipt_len; /* size of structure (variable) */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:191:2: error: unknown type name 'u_char'; did you mean 'char'?
u_char ipt_ptr; /* index of current entry */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:193:2: error: unknown type name 'u_int'
u_int ipt_flg:4, /* flags, see below */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:197:2: error: unknown type name 'u_int'
u_int ipt_oflw:4, /* overflow counter */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:197:10: error: duplicate member 'ipt_oflw'
u_int ipt_oflw:4, /* overflow counter */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:194:6: note: previous declaration is here
ipt_oflw:4; /* overflow counter */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:198:6: error: duplicate member 'ipt_flg'
ipt_flg:4; /* flags, see below */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/netinet/ip.h:193:10: note: previous declaration is here
u_int ipt_flg:4, /* flags, see below */
^
18 errors generated.
make[2]: *** [examples/CMakeFiles/gl_basic.dir/gl_basic.c.o] Error 1
make[1]: *** [examples/CMakeFiles/gl_basic.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
I was able to fix this by passing "-D_DARWIN_C_SOURCE" as CFLAGS.
Could you please have a look. Maybe it's not the right fix, thus I am reporting the issue so you can investigate. Thanks
See https://github.com/Homebrew/homebrew-core/pull/135056 for reference