GCC5 unhappy with AnimNodeLoader.cpp.o


#1

Probably not a general GCC5 issue as a week ago my first compile under GCC5 went through flawlessly. However since the below has persisted for a few days I assume most people are not using GCC5 and are not encountering the issue.

Building CXX object libraries/animation/CMakeFiles/animation.dir/src/AnimNodeLoader.cpp.o
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp: In function ‘bool processStateMachineNode(AnimNode::Pointer, const QJsonObject&, const QString&, const QUrl&)’:
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:78:16: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
         return nullptr;                                                 \
                ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:281:5: note: in expansion of macro ‘READ_STRING’
     READ_STRING(currentState, jsonObj, nodeId, jsonUrl);
     ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:286:16: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
         return nullptr;
                ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:305:20: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
             return nullptr;
                    ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:78:16: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
         return nullptr;                                                 \
                ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:309:9: note: in expansion of macro ‘READ_STRING’
         READ_STRING(id, stateObj, nodeId, jsonUrl);
         ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:105:16: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
         return nullptr;                                                 \
                ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:310:9: note: in expansion of macro ‘READ_FLOAT’
         READ_FLOAT(interpTarget, stateObj, nodeId, jsonUrl);
         ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:105:16: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
         return nullptr;                                                 \
                ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:311:9: note: in expansion of macro ‘READ_FLOAT’
         READ_FLOAT(interpDuration, stateObj, nodeId, jsonUrl);
         ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:321:20: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
             return nullptr;
                    ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:340:20: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
             return nullptr;
                    ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:347:24: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
                 return nullptr;
                        ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:78:16: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
         return nullptr;                                                 \
                ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:351:13: note: in expansion of macro ‘READ_STRING’
             READ_STRING(var, transitionObj, nodeId, jsonUrl);
             ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:78:16: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
         return nullptr;                                                 \
                ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:352:13: note: in expansion of macro ‘READ_STRING’
             READ_STRING(state, transitionObj, nodeId, jsonUrl);
             ^
/usr/src/hifi/libraries/animation/src/AnimNodeLoader.cpp:366:20: error: converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization [-fpermissive]
             return nullptr;
                    ^
libraries/animation/CMakeFiles/animation.dir/build.make:123: recipe for target 'libraries/animation/CMakeFiles/animation.dir/src/AnimNodeLoader.cpp.o' failed
make[2]: *** [libraries/animation/CMakeFiles/animation.dir/src/AnimNodeLoader.cpp.o] Error 1
CMakeFiles/Makefile2:1342: recipe for target 'libraries/animation/CMakeFiles/animation.dir/all' failed
make[1]: *** [libraries/animation/CMakeFiles/animation.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2

#2

Thanks, for the bug report, I’ll have a PR to fix this ASAP, it’s probably as simple as casting to bool or returning false instead of nullptr in the appropriate locations.


#3

It’s not as simple as a cast, because it’s in a macro that does return nullptr that’s used in both functions that return bool and in functions that return a pointer.

I actually made a pull request for this: https://github.com/highfidelity/hifi/pull/5731

I solved it with https://github.com/ChristophHaag/hifi/commit/ddcee763ca68db0c96c5721c42c85df881d22374 but I don’t think that’s a very nice solution.


#4

Hmm got this issue as well on Fedora 22.


#5

Nice solution or not, my compile went through this morning.
Thanks.

(Now I’m just waiting for MESA11 to be released, then hit the Debian/unstable repository, and I am - hopefully - ready to roll again). :smile:


#6

Then maybe I’ll finally get to know if I’m the only one only getting a black window with mesa in vr mode: https://alphas.highfidelity.io/t/linux-mesa-and-oculus-rift-sdk/6716/7