[Qt-creator] Minimizing compile-time conditionals in Qt Creator

Stephen Chu stephen at ju-ju.com
Tue Aug 28 14:19:20 CEST 2012


On 8/28/12 3:56 AM, Christian Kandeler wrote:
>       QStringList rc(QLatin1String(".svn"));
>       if (Utils::HostOsInfo::isWindowsHost())
>           rc.push_back(QLatin1String("_svn"));
>       return rc;

Doesn't this generate dead code that will never be executed on platforms 
other than the intended one?

My understanding is unless the function is declared as constexp and 
build with C++11 option, the compiler will not be able to optimize out 
the code for non-targeted platform.




More information about the Qt-creator mailing list