GCC 8 enables -Werror=return-type by default which combined with -Werror causes the build to fail.
Added test case that reproduces the problem.