Fix build for GCC 7
This fixes building with GCC 7 which fails with "ISO C++ forbids comparison between pointer and integer [-fpermissive]"