On 09/17/2012 08:50 AM, Stephen Kelly wrote:
> I've fixed all errors and warnings that can be fixed. Some remain due to
> compiler bugs which claim some code in a template is unreachable (but that's
> only due to the template parameters).
The HP warnings are not a compiler bug. It looks like other compilers
picked up on it too but you suppressed the warnings in the topic.
In this code:
template<bool linker, bool soname, bool dirQual, bool nameQual>
...
// TODO: static_assert(!(name && dir))
if(nameQual)
{
return cmSystemTools::GetFilenameName(result);
}
else if (dirQual)
{
return cmSystemTools::GetFilenamePath(result);
}
return result;
when either nameQual or dirQual is true that is a compile-time constant
so the "return result" line is truly unreachable in that instantiation.
You need to use compile-time conditional code rather than "runtime"
tests of compile-time constants. This is true for the other template
parameters too.
> I think it would make sense to rewrite the branch to squash the whitespace
> fixes before merging to master though.
Yes, I can do this when the topic is done.
-Brad
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers