Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

warning #279: controlling expression is constant

jimdempseyatthecove
Honored Contributor III
1,334 Views
I downloaded the Smoke demo program. When compiling withIntel C++ 11.0.066on x64/Debugproject OgreMainmany files receive

warning #279: controlling expression is constant

Example

[cpp]inline void setExtents( const Vector3& min, const Vector3& max )
{
  assert( (min.x <= max.x && min.y <= max.y && min.z <= max.z) &&
    "The minimum corner of the box must be less than or equal to maximum corner" );

  mExtent = EXTENT_FINITE;
  mMinimum = min;
  mMaximum = max;
}
[/cpp]

The error message occures on the assert line. Must have something to do with "const" yet the expression is not constant due to min and max not being known at compile time.


Jim
0 Kudos
3 Replies
srimks
New Contributor II
1,334 Views
I downloaded the Smoke demo program. When compiling with Intel C++ 11.0.066 on x64/Debug project OgreMain many files receive

warning #279: controlling expression is constant

Example

[cpp]inline void setExtents( const Vector3& min, const Vector3& max )
{
assert( (min.x <= max.x && min.y <= max.y && min.z <= max.z) &&
"The minimum corner of the box must be less than or equal to maximum corner" );

mExtent = EXTENT_FINITE;
mMinimum = min;
mMaximum = max;
}
[/cpp]

The error message occures on the assert line. Must have something to do with "const" yet the expression is not constant due to min and max not being known at compile time.


Jim
Hi.

Could you send the PATH as I don't find the same file in "/apps/intel/cce/11.0.074/samples/C++" PATH where ICC-v11.0 is installed.

Also, I am getting error messages while compiling it's "Samples/C++/vec_samples" & "/Samples/C++/optimize" example files, probably I didn't miss anything with simple icc compilation command and as recoomeded in it's comment within the file.

~BR
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,334 Views

BR,

I am running on Windows and this application (Smoke) is not part of the C++ samples.

For others, my concern is if the compiler determines the enclosed expression assert((expression)) is constant, which it is not, then the optimization code will either remove the code all together or always call the assert debug routine.

Jim
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,334 Views

Follow-up:

I saw on the Havok forum that tryHavok does not include x64 libraries. This should not affect the compilation to target x64 (the warning #279).

I installed the x32 version of Intel C++ and set the platform for Win32. Compiling the OgreMain using ICC x32 still gets the errors.

Using MS CV++ (VS 2005) compiles without these warnings.

Therefore I think either ICC has a bug or there is an issue with a #define when compiling using ICC

Jim Dempsey
0 Kudos
Reply