#pragma warning format changed?

#pragma warning format changed?

I had this code for years:

# pragma warning(disable:810) /* conversion may lose significant bits */ # pragma warning(disable:69) /* integer conversion resulted in truncation */ 
but sometime, maybe when we started using v11, these stopped suppressing the error. I found on a board somewhere this syntax:
#pragma warning disable 810 /* conversion ... may lose significant bits */ #pragma warning disable 69 /* integer conversion resulted in truncation */ 
which now works fine. Did something change somewhere? This is on Windows, icl 11.1.060.

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Could you please give usa complete example, i.e. a test case and your compilation command?

I tried this simpletest case which disables warning 1079 (return type of function main must be int)with 11.1 and it works as expected:

#pragma warning (disable:1079)

void main() {}


I'm finding problems with 13.0 in disabling and restoring warnings. I can't find any documentation on it

#pragma warning disable 304 // this works
#pragma warning restore 304 // this doesn't work
#pragma (push) // this
#pragma warning(disable:304) // doesn't
#pragma (pop) // work

What I really want to do is disable all warnings for a small section. On MSVC you can do

#pragma warning(push, 0)
#pragma warning(pop)

Which works great - no such luck with Intel compiler.


Please show a complete example where you think these pragmas are not working.

I created this example which works as expected:

!% cat t.cpp

struct Base {};

#pragma warning push
#pragma warning(disable:304)
struct Derived: Base {};  // remark is disabled here
#pragma warning pop

struct Derived2: Base {}; // but not here

!% icl -c -W5 t.cpp
Intel(R) C++ Compiler XE for applications running on IA-32, Version Mainline Bet
a Build x
Built Mar 17 2013 16:26:48 by jward4 on JWARD4-DESK in D:/workspaces/46cfe/dev
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.

t.cpp(9): remark #304: access control not specified ("public" by default)
  struct Derived2: Base {}; // but not here




P.S. If the class is a template class you need to have the diagnostic disabled at the point of the instantiation.

I'm currently using three versions of Intel C++ compiler ( versions 8.x, 12.x, and 13.x ) on a project and there is a set of warnings which I could never was able to disable in sources. Here is a list of these warnings and they are disabled in a Visual Studio project files using option /Qwd:

.../Qwd 111,114,174,177,181,279,304,424,444,593,673,810,869,981,1011,1418,1572...

I consider it as a problem ( a bug ) and it needs to be fixed.


I'll try to provide more details for 304 and 810 warnings some time next week.

Leave a Comment

Please sign in to add a comment. Not a member? Join today