C1XX -noC3222

Syntax

This option has no arguments. It is -noC3222 only.

This option is not recognised on the CL command line, but can be passed to C1XX through the CL /d1 option, giving noC3222 as its argument.

Behaviour

It is generally not permitted for a managed type to have a method declared with a default argument. Failure to respect this requirement results in error C3222, as with Microsoft’s example (compiled, of course, with the /clr option):

#using <mscorlib.dll>

__gc class Test
{
    void method (int n = 0);    // C3222
}

Microsoft helpfully notes that “an overloaded form of the method is one way to work around this issue.” Another is to know that the (undocumented) -noC3222 option lifts the restriction.

That said, it is not known whether the compiler, with the restriction lifted, then proceeds to generate correct code: undocumented options are sometimes undocumented precisely because they are experimental or unreliable.