Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
7677 Discussions

Remark #174: expression has no effect - RESOLVED

SergeyKostrov
Valued Contributor II
432 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
432 Views
Could you please attach the testcase?
SergeyKostrov
Valued Contributor II
432 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

Reply