[MacPorts] #58726: libvirt @5.5.0: error: expected '; ' before 'virTemporaryReturnPointer'
MacPorts
noreply at macports.org
Thu Jul 18 20:19:45 UTC 2019
#58726: libvirt @5.5.0: error: expected ';' before 'virTemporaryReturnPointer'
----------------------+------------------------
Reporter: kencu | Owner: ryandesign
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libvirt |
----------------------+------------------------
Comment (by kencu):
The port will not build on Mojave with `-std=c99` set in the Portfile:
{{{
/bin/sh ../libtool --tag=CC --mode=compile /usr/bin/clang
-DHAVE_CONFIG_H -I. -I.. -I../gnulib/lib -I../gnulib/lib -I..
-I../include -I../include -I./util -I./util -DIN_LIBVIRT
-Dabs_top_builddir="\"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_libvirt/libvirt/work/libvirt-5.5.0\""
-Dabs_top_srcdir="\"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_sysutils_libvirt/libvirt/work/libvirt-5.5.0\""
-I/opt/local/include
-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
-I/opt/local/include/yajl -I/opt/local/include/libxml2 -fno-common -W
-Waddress -Wall -Wattributes -Wbad-function-cast -Wbuiltin-macro-redefined
-Wcast-align -Wchar-subscripts -Wcomment -Wcomments -Wcpp -Wdangling-else
-Wdate-time -Wdeprecated-declarations -Wdiv-by-zero -Wdouble-promotion
-Wduplicate-decl-specifier -Wempty-body -Wendif-labels -Wexpansion-to-
defined -Wextra -Wformat-extra-args -Wformat-security -Wformat-y2k
-Wformat-zero-length -Wignored-attributes -Wignored-qualifiers -Wimplicit
-Wimplicit-function-declaration -Wimplicit-int -Wincompatible-pointer-
types -Winit-self -Winline -Wint-conversion -Wint-to-pointer-cast
-Winvalid-pch -Wlogical-not-parentheses -Wmain -Wmemset-transposed-args
-Wmissing-braces -Wmissing-declarations -Wmissing-field-initializers
-Wmissing-include-dirs -Wmissing-prototypes -Wmultichar -Wnarrowing
-Wnested-externs -Wnonnull -Wnull-dereference -Wodr -Wold-style-definition
-Woverflow -Wparentheses -Wpointer-arith -Wpointer-sign -Wpointer-to-int-
cast -Wpragmas -Wreturn-type -Wsequence-point -Wshadow -Wshift-count-
negative -Wshift-count-overflow -Wshift-negative-value -Wsizeof-array-
argument -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-prototypes
-Wswitch -Wswitch-bool -Wtautological-compare -Wtrigraphs -Wtype-limits
-Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-
label -Wunused-local-typedefs -Wunused-parameter -Wunused-result -Wunused-
value -Wunused-variable -Wvarargs -Wvariadic-macros -Wvolatile-register-
var -Wwrite-strings -Wno-sign-compare -Wswitch-enum -Wno-format-nonliteral
-fexceptions -fasynchronous-unwind-tables -Wframe-larger-than=4096
-I/opt/local/include/p11-kit-1 -pipe -Os -std=c99
-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
-arch x86_64 -MT util/libvirt_util_la-virmodule.lo -MD -MP -MF util/.deps
/libvirt_util_la-virmodule.Tpo -c -o util/libvirt_util_la-virmodule.lo
`test -f 'util/virmodule.c' || echo './'`util/virmodule.c
util/virhostdev.c:202:5: warning: implicit declaration of function
'typeof' is invalid in C99 [-Wimplicit-function-declaration]
VIR_RETURN_PTR(hostdevMgr);
}}}
If `-std=c99` is removed, and no standard is set, then the port builds
again on Mojave. So Apple's clang does accept the `typeof` keyword by
default, as opposed to llvm's clang, which does not.
Using `-std=gnu99` the port does build with Mojave using the default
clang, and also builds with llvm's clang (5 and 8 tested).
So that appears to be a safe fix.
Upstream could consider using `__typeof__` instead of `typeof` and then we
would not need to worry about C standards at all.
--
Ticket URL: <https://trac.macports.org/ticket/58726#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list