<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated on Sun, 12 Feb 2012 11:14:49 -0800 -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <atom:link href="http://software.intel.com/en-us/articles/cdiag279/feed/" rel="self" type="application/rss+xml" />
    <title>Intel Software Network Comments Feed</title>
    <link>http://software.intel.com/en-us/articles/cdiag279</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>By Konstantine Smaguine</title>
      <description><![CDATA[ This diagnostic shows up on statements like:

assert(!"this is the text which will get displayed if this dead code branch is hit");

or

assert(x < y || !"x should be less than y here because ...");

have not found a workaround.
 ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag279/#comment-52828</link>
      <pubDate>Thu, 02 Dec 2010 07:02:34 -0800</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag279/#comment-52828</guid>
    </item>
    <item>
      <title>By Jennifer Jiang (Intel)</title>
      <description><![CDATA[ I used a chello.cpp to try the "assert()", but could not get the diagnostic to emit. I used /Od /D_DEBUG /DDEBUG t.cpp with icl 11.1 or 12.0. Can you show me a more complete test and cmd line? 

Thanks! ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag279/#comment-54460</link>
      <pubDate>Wed, 05 Jan 2011 09:02:51 -0800</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag279/#comment-54460</guid>
    </item>
    <item>
      <title>By Orhun</title>
      <description><![CDATA[ Here is an example with visual studio 2010 command line,

#include <cassert>
int main()
{
    assert(false && "This will generate an controlling expression is constant warning with Intel C++");
}

>main.cpp(5): warning #279: controlling expression is constant
1>        assert(false && "This will generate an controlling expression is constant warning with Intel C++");
1>        ^

Command Line : Visual Studio 2010 : (the trick is /W4)
/Zi /nologo /W4 /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /EHsc /RTC1 /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fp"x64Debugit1.pch" /Fa"x64Debug" /Fo"x64Debug" /Fd"x64Debugvc100.pdb" 
 ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag279/#comment-56963</link>
      <pubDate>Wed, 02 Mar 2011 23:00:28 -0800</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag279/#comment-56963</guid>
    </item>
    <item>
      <title>By Luca</title>
      <description><![CDATA[ Actually, this is a problem on Linux as well.

If you have

assert(false && "this should never happen");

you get the warning.
On my platform (kubuntu 10), assert(x) essentially expands to

((x) ? 0 : __assert_fail (__STRING(x), __FILE__, __LINE__, __func__))

which means something is checking (x) without noticing that it actually came from an assertion.

The real problem here is that the warning is indeed very useful IF the expression (x) does not contain
only compile-time constants. In other words: look at what x is made of, if they're all compile-time constants
don't warn, otherwise warn.

Happy to be contacted personally on the email provided for further discussion, if you need more help.
Luca ]]></description>
      <link>http://software.intel.com/en-us/articles/cdiag279/#comment-64841</link>
      <pubDate>Mon, 26 Sep 2011 00:21:37 -0700</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/articles/cdiag279/#comment-64841</guid>
    </item>
  </channel></rss>
