/WX Option Causes Suppression of C4101 & C4102 WarningsLast reviewed: July 17, 1997Article ID: Q85875 |
7.00 | 1.00 1.50 1.51
MS-DOS | WINDOWS
kbtool
The information in this article applies to:
SUMMARYThe /WX switch causes the following two warnings
warning C4102: identifier : unreferenced label warning C4101: identifier' : unreferenced local variableto be suppressed after any warning occurs. To see all the warnings, the /WX switch must be omitted.
MORE INFORMATIONNormally, the compiler continues to generate errors until the end of compilation or until a fatal error occurs. Because the /WX switch causes warnings to be treated as nonfatal errors, one might expect to see all other occurrences of the C4101 and C4102 warnings. This is not the case. NOTE: This behavior does not occur using Visual C++ 32-bit Edition. With the following sample code, if the following command line is used
cl /W4 /WX file.cthe compiler will only generate the following warnings:
warning C4035: 'main' : no return value error C2220: warning treated as error - no object file generatedIf we omit the /WX compiler option, the compiler generates the following warnings:
warning C4035: 'main' : no return value warning C4102: 'Label' : unreferenced label warning C4101: 'b' : unreferenced local variable warning C4101: 'c' : unreferenced local variable Sample CodeIn the sample code below, note that by removing the /WX switch, the compiler issues all the warnings.
/* Compile options needed: /W4 /WX */ #include <stdio.h>main(void) { int a = 1; int b ; int c ;Label: printf (" a = %d \n");}
|
Additional reference words: kbinf 1.00 1.50 7.00 8.00 8.00c
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |