Suppress unused variable warning in C++ => Compiler bug or code bug?
问题 Presently, I am using the following function template to suppress unused variable warnings: template<typename T> void unused(T const &) { /* Do nothing. */ } However, when porting to cygwin from Linux, I am now getting compiler errors on g++ 3.4.4 (On linux I am 3.4.6, so maybe this is a bug fix?): Write.cpp: In member function `void* Write::initReadWrite()': Write.cpp:516: error: invalid initialization of reference of type 'const volatile bool&' from expression of type 'volatile bool' ../..