Fix boost (>= 1.66) on gcc 4.9.3
- Dominant language
- C++
- Stars
- 80
- Forks
- 184
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
When trying to use boost 1.66 on gcc 4.9.3 (not sure about 4.9.4; we use gcc 4.9.3 as it is the last "known good" version for `gccxml`) we encountered a strange bug related to gcc's handling of `__has_include`:
The macro is defined but not implemented correctly.
Our workaround was to conditionally undefine the macro when encountering gcc 4.9.x.
```diff
diff -rpu boost_1_66_0_old/boost/config/stdlib/libstdcpp3.hpp boost_1_66_0/boost/config/stdlib/libstdcpp3.hpp
--- boost_1_66_0_old/boost/config/stdlib/libstdcpp3.hpp 2017-12-14 00:56:42.000000000 +0100
+++ boost_1_66_0/boost/config/stdlib/libstdcpp3.hpp 2018-04-25 16:42:42.627694409 +0200
@@ -301,6 +301,11 @@ extern "C" char *gets (char *__s);
# define BOOST_NO_CXX17_STD_APPLY
#endif
+#if defined(__GNUC__) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 9) && defined(__has_include)
+// gcc 4.9.x defines but does not implement it
+#undef __has_include
+#endif
+
#if defined(__has_include)
#if !__has_include()
# define BOOST_NO_CXX14_HDR_SHARED_MUTEX
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in boost/config/stdlib/libstdcpp3.hpp and inspect the existing __has_include handling for GCC 4.9.x. Verify the compatibility behavior with GCC 4.9.3, and confirm that the change does not affect other compiler versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100