Summary: | dev-util/source-highlight-3.1.7-r2: building w/gcc-6: ./stdbool.h:112:70: error: expected ';', identifier or '(' before '_Bool' typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Peter Levine <plevine457> |
Component: | [OLD] GCC Porting | Assignee: | Tiziano Müller (RETIRED) <dev-zero> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | plevine457 |
Priority: | Normal | Keywords: | PATCH, UPSTREAM |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=632090 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 582084 | ||
Attachments: |
source-highlight-3.1.7-r2:20160510-232715.log.gz
emerge --info source-highlight-3.1.7-cpp11-gcc6.patch |
Description
Peter Levine
2016-05-10 23:38:41 UTC
Created attachment 433888 [details]
source-highlight-3.1.7-r2:20160510-232715.log.gz
Created attachment 433890 [details]
emerge --info
The problem is either with gcc-6 or with gl/m4/stdbool.m4 In a conftest the equivalent of the following code is used: > #include <stdbool.h> > #ifndef bool > "error: bool is not defined" > #endif > int main () { > return 0; > } If one stores this as "conftest.cpp" and executes: > x86_64-pc-linux-gnu-g++ -c -march=native -O2 -pipe conftest.cpp With gcc-5, this compiles fine. With gcc-6, I get: > conftest.cpp:3:2: error: expected unqualified-id before string constant This implies that "bool" exists as a macro in gcc-5 but not gcc-6. I don't remember seeing anything in the GCC-6 release notes about a change in the behaviour of the "bool" keyword, just some changes in what can be implicitly cast from a boolean type. Herein lies the problem: https://gcc.gnu.org/ml/gcc-patches/2014-10/msg02594.html C++ dialects from C++11 onward are not supposed to define bool, false, or true as macros. This messes up configure into forcing the inclusion of it's own stdbool.h. Aside from that, the boost ebuild has to be changed to not include the line: > append-cxxflags -std=gnu++98 There are incompatibilities that break the build otherwise. I'm not sure if that should even be filed as a separate bug as there are many other packages that appear to break if compiled with different gcc major versions (dev-qt/* built with gcc-6 breaks most kde plasma5 builds if then built with gcc-5). Not sure how Gentoo can/will handle this. Created attachment 435722 [details, diff] source-highlight-3.1.7-cpp11-gcc6.patch Patch for >=source-highlight-3.1.7. Submitted upstream: https://savannah.gnu.org/bugs/index.php?48053 commit a20f82824bff15ec83702f07697f3b2433a17e5c Author: David Seifert <soap@gentoo.org> Date: Sat Oct 8 20:43:39 2016 +0200 dev-util/source-highlight: Version bump to 3.1.8 Gentoo-bug: 507112, 579002, 582694, 582696 * EAPI=6 * Build using C++14 mode (due to boost-1.62) |