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

Konstantin Tokarev annulen at yandex.ru
Tue Aug 28 14:21:38 CEST 2012



28.08.2012, 16:19, "Stephen Chu" <stephen at ju-ju.com>:
> 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.

Your understanding is correct, but probably elimination of dead code is not too
interesting here.

-- 
Regards,
Konstantin



More information about the Qt-creator mailing list