- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As for the first issue (why the 2415 is not disabled). You'll notice if you remove the #pragma warning (pop) the warning is disabled. The compiler does not actually issue the warning until the end of the file (when it can actually tell the Label was never referenced). At that point the warning stack has been popped by the #pragma warning (pop). So unfortunately this specific warning cannot be disabled by putting push/pop around the declaration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As for the second issueit looks like you need to use /Werror-all instead of /WX if you want the remarks that come out with the /W4 option to be treated as errors.
This is what the help says:
/WX force warnings to be reported as errors
/Werror-all
force warnings and currently enabled remarks to be reported as errors
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For me warnings and remarks are reported as errors.
------------------------------------
c:\forum\U106251>type tstcase.cpp
#include
#pragma warning( push )
#pragma warning (disable: 2415)
static const char * Label= "LABEL"; //warning #2415: variable "Label" of static
storage duration was declared but never referenced
#pragma warning( pop )
int main(void)
{
unsigned count=10;
for(int i=0;i
gned operands
{
printf("%d\n",i);
}
return 0;
}
------------------
c:\forum\U106251>icl -c -W4 -Werror-all tstcase.cpp
Intel C++ Intel 64 Compiler XE for applications running on Intel 64, Version 12.1.1.258 Build 20111011
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
tstcase.cpp
tstcase.cpp(9): error #2557: comparison between signed and unsigned operands
for(int i=0;i
^
tstcase.cpp(4): error #2415: variable "Label" of static storage duration was declared but never referenced
static const char * Label= "LABEL"; //warning #2415: variable "Label" of static storage duration was declared but never referenced
^
compilation aborted for tstcase.cpp (code 2)
c:\forum\U106251>icl -V
Intel C++ Intel 64 Compiler XE for applications running on Intel 64, Version 12.1.1.258 Build 20111011
Copyright (C) 1985-2011 Intel Corporation. All rights reserved.
icl: command line warning #10155: ignoring option '/V'; argument required
icl: command line error: no files specified; for help type "icl /help"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page