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

Remark #174: expression has no effect - RESOLVED

SergeyKostrov
Valued Contributor II
1,286 Views

Please take a look at a Test-Case:

...
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
...

------ Build started: Project: IccTestApp, Configuration: Release Win32 ------
Compiling with Intel C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment)
IccTestApp.cpp
../Common/PrtTests.cpp(5788): remark #174: expression has no effect
_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
^
...

My question is: Why "the expression has no effect"?

Development Environment:

OS: Windows XP 32-bit
IDE: Visual Studio 2005 SP1
Compilers: Intel C++ / Microsoft C++ / Borland C++ / MinGW / Turbo C++

Best regards,
Sergey

0 Kudos
2 Replies
Om_S_Intel
Employee
1,286 Views
Could you please attach the testcase?
0 Kudos
SergeyKostrov
Valued Contributor II
1,286 Views
Could you please attach the testcase?


You need to include a 'crtdbg.h' header file and in a Release configurationwith Warning Level 5you should see
that remark.

However, Iunderstoodwhy it happens because for Release the declaration of '_CrtSetDbgFlag'in 'crtdbg.h'looks like:

...
#define _CrtSetDbgFlag( f ) ((int)0)
...

Thank you for your time!

Best regards,
Sergey

0 Kudos
Reply