conform
C++ Specific
#pragma conform(name, pop)
#pragma conform(name, push, on | off)
#pragma conform(name, on | off)
#pragma conform(name, show)
Specifies the run-time behavior of the /Zc compiler options.
- name
The name of the option to modify. For example, forScope. - pop
Sets the value of name to the value at the top of the stack and then pops the stack. The first entry on the stack is the setting of the compiler option as it would appear on the command line; this cannot be popped. You will get a warning if you attempt to pop the stack when there is only one element on the stack. - push, on | off
An on or off value for name is pushed on the stack. The default value for a push is off. For example,#pragma conform(forScope, push)
, which is equivalent to#pragma conform(forScope, push, off)
. You can specify multiple push and pop operations so care should be taken to match every push with a pop. - on | off
Lets you change the value of the element currently at the top of the stack for name. For example,#pragma conform(forScope, off)
. - show
Causes the current setting of name to be displayed, via warning message, during compilation. For example,#pragma conform(forScope, show)
.
For example, consider this short sample:
// compile with cl /c /Zc:forScope #pragma conform(forScope, show) #pragma conform(forScope, push) #pragma conform(forScope, show) #pragma conform(forScope, pop) #pragma conform(forScope, show) #pragma conform(forScope, pop)
Generates the following output:
warning C4811: value of pragma conformForScope(show) == true warning C4811: value of pragma conformForScope(show) == false warning C4811: value of pragma conformForScope(show) == true warning C4161: #pragma conform(pop...) : more pops than pushes