#1101 nullptr test fails if configureflags include -Werror
Metadata
| Property | Value | 
|---|---|
| Reported by | Matthias Wohlmuth (matthias.wohlmuth@ma.tum.de) | 
| Reported at | May 10, 2012 12:13 | 
| Type | Bug Report | 
| Version | Git (pre2.4) [autotools] | 
| Operating System | Linux | 
| Last edited by | Christian Engwer (christi@conan.iwr.uni-heidelberg.de) | 
| Last edited at | May 23, 2012 10:01 | 
| Closed by | Christian Engwer (christi@conan.iwr.uni-heidelberg.de) | 
| Closed at | May 23, 2012 10:01 | 
| Closed in version | Unknown | 
| Resolution | Fixed | 
| Comment | patch applied to trunk | 
Description
The current implementation of the nullptr check results in an unused variable warning. Thus, if Dune is configured with -Werror, the build system claims that there is no nullptr implementation present and adds the fallback implementation in dune/common/nullptr.h . However, if it is present in one of the system includes, this causes a compiler error because of two colliding nullptr implementations (system and fallback). So I propose to fix the unused variable warning, for example by the following patch:
--- cxx0x_nullptr.m4    (revision 6709)
+++ cxx0x_nullptr.m4    (working copy)
@@ -5,6 +5,7 @@
AC_LANG_PUSH([C++])
AC_TRY_COMPILE([],[
char* ch = nullptr;
- 
if(ch!=nullptr) { ; } ], dune_cv_nullptr_support=yes, dune_cv_nullptr_support=no)