Emerging media-libs/devil-1.7.8-r2 fails with a compile error from gcc: In file included from ./../src-IL/src/il_exr.cpp:14:0: ./../src-IL/include/il_internal.h:230:54: error: expected ‘,’ or ‘...’ before ‘FileName’ ILboolean ilIsValidBmp(ILconst_string CONST_RESTRICT FileName); Reproducible: Always build log: https://bpaste.net/show/8328cc5e16b4 ---- emerge -pqv '=media-libs/devil-1.7.8-r2::gentoo': [ebuild N ] media-libs/devil-1.7.8-r2 USE="X gif jpeg jpeg2k mng opengl png sdl tiff xpm -allegro -glut -nvtt -openexr -static-libs" CPU_FLAGS_X86="sse sse2 -sse3" ---- emerge --info '=media-libs/devil-1.7.8-r2::gentoo': https://bpaste.net/show/ef5c0f4f0312
Attach your build log to the bug; patebins are not acceptable.
Created attachment 405456 [details] build.log
Created attachment 405458 [details] emerge --info output
Done, attached both the build.log and the emerge --info output. Sorry for using a pastebin at first. This was my first time reporting a bug on the gentoo bugzilla. I didn't know.
i'd guess a bug in devil. the error message indicates CONST_RESTIRCT isn't being defined and that's something devil itself sets up.
I was hoping for some direction about the change in behavior between gcc4 and gcc5 since devil builds fine with current stable gcc4. The line that's erroring is: ILboolean ilIsValidBmp(ILconst_string CONST_RESTRICT FileName); and CONST_RESTRICT is defined as const restrict and ILconst_string is defined as wchar_t const * so... doesn't like wchar_t const * const restrict FileName now?
(In reply to Mr. Bones. from comment #6) then you want the gcc-porting@ alias ;) the problem is that the devil configure script tests for the "restrict" keyword using the C frontend. in C99, this keyword was added to C. however, C++ has no such keyword, and the header uses that single test to determine language functionality for both C and C++. it's further complicated by the fact that gcc-5 switched from C89 as the default standard to C11 -- C89 didn't have restrict, but C99/C11 do, so the configure tests now pass. you could hack around it by doing: sed -i '/RESTRICT/s:restrict:__restrict__:' include/IL/il.h if you wanted something more complete, then maybe use "#ifdef __cplusplus" and either do: #ifdef __cplusplus # undef RESTRICT_KEYWORD #endif or something like: #ifdef RESTRICT_KEYWORD # ifdef __cplusplus # define RESTRICT restrict # else # define RESTRICT __restrict__ # endif #endif it also looks like RESTRICT_KEYWORD is doubly defined because the autotool logic has two independent tests: m4/devil-definitions.m4: AC_DEFUN([DEVIL_CHECK_RESTRICT], AC_DEFUN([DEVIL_CHECK_RESTRICT_GNU99], which you can see in the config.log w/gcc-5: conftest.c:24:0: warning: "RESTRICT_KEYWORD" redefined #define RESTRICT_KEYWORD 1 ^ conftest.c:23:0: note: this is the location of the previous definition #define RESTRICT_KEYWORD /**/ ^
Created attachment 410928 [details, diff] Fix usage of restrict keyword This patch fixed the issue on my machine and devil merged fine with gcc-5.2.0
great! thanks for the patch. In portage.