Summary: | media-libs/devil-1.7.8-r2: build failure with gcc-5.1 due to use of "restrict" keyword in C++ code | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Jasen Borisov <tajjada> |
Component: | [OLD] GCC Porting | Assignee: | Gentoo Games <games> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-porting, sven.eden |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 536984 | ||
Attachments: |
build.log
emerge --info output Fix usage of restrict keyword |
Description
Jasen Borisov
2015-06-17 08:55:09 UTC
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. |