[mythtv] macOS compile error by 1263ee2

David Hampton mythtv at love2code.net
Sat Oct 6 14:37:50 UTC 2018


On Sat, 2018-10-06 at 11:39 +0200, Piotr Oniszczuk wrote:
> David,
> 
> FYI:
> 
https://github.com/MythTV/mythtv/commit/1263ee2c0b9200889b399214853925a9212697ca#diff-700d79812c59ba30d4068a012dac089e
> 
> causing me following compile error on macOSX 10.13.6, Xcode 10A255,
> Qt5.11.1
> 
> ccache
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xc
> toolchain/usr/bin/clang++ -c -pipe -stdlib=libc++
> -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/
> Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.9
> -I/Users/piotro/Devel/mythtv-master/.osx-packager/build/include
> -I/Users/piotro/Devel/mythtv-master/.osx-packager/build/mysql
> -std=c++11 -DNDEBUG -fomit-frame-pointer -fPIC
> -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -msse -pthread -g -Wall
> -Wextra -Wpointer-arith -D__STDC_CONSTANT_MACROS
> -D__STDC_LIMIT_MACROS -Wno-constant-logical-operand -Wno-unused-value 
> -Qunused-arguments -Wimplicit-fallthrough -faligned-allocation
> -std=gnu++11  -arch x86_64 -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/
> Developer/SDKs/MacOSX10.14.sdk -mmacosx-version-min=10.11 -fPIC -DMMX
> -DUSING_APPLEREMOTE -D_GNU_SOURCE -DSERVICE_API -DQT_NO_DEBUG
> -DQT_GUI_LIB -DQT_SCRIPT_LIB -DQT_CORE_LIB -I. -I../libmythbase
> -Ienums -Idatacontracts -Iservices -I../libmyth -I../libmythbase
> -I/Users/piotro/Devel/Qt5.11.1SDK/5.11.1/clang_64/lib/QtGui.framework
> /Headers
> -I/Users/piotro/Devel/Qt5.11.1SDK/5.11.1/clang_64/lib/QtScript.framew
> ork/Headers
> -I/Users/piotro/Devel/Qt5.11.1SDK/5.11.1/clang_64/lib/QtCore.framewor
> k/Headers -Imoc
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platfor
> m/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/OpenGL.fra
> mework/Headers
> -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platfor
> m/Developer/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/AGL.framew
> ork/Headers
> -I/Users/piotro/Devel/Qt5.11.1SDK/5.11.1/clang_64/mkspecs/macx-clang
> -F/Users/piotro/Devel/Qt5.11.1SDK/5.11.1/clang_64/lib -o
> obj/moc_programList.o moc/moc_programList.cpp
> warning: include path for stdlibc++ headers not found; pass '-
> std=libc++' on the command line to use the libc++ standard library
> instead [-Wstdlibcxx-not-found]
> util-osx.cpp:53:16: error: cannot initialize return object of type
> 'CGDirectDisplayID' (aka 'unsigned int') with an rvalue of type
> 'nullptr_t'
>         return nullptr;
>                ^~~~~~~
> 1 warning and 1 error generated.
> make[2]: *** [obj/util-osx.o] Error 1
> make[2]: *** Waiting for unfinished jobs….

Looks like that should be 0 instead of nullptr.  My apologies.

David

P.S. I think this is an example of exactly why nullptr was created. The
original code had NULL when it should have had 0.  Because NULL is
defined to 0 the compiler built the right code, but reading the code
gave the impression that it was returning a pointer.

P.P.S. I really have to get a mac development environment set up.  I
keep hoping Apple will release a new Mac Mini, so I don't have to spend
money on a old design that may be obsoleted any day now.




More information about the mythtv-dev mailing list