CL /u

Syntax

This option takes no argument. It is /u only.

Relations

This option is handled entirely within CL. It generates nothing that passes to any compiler module.

Behaviour

The /u option removes all /D options that are either set as initial options or weakly implied by other options.

/D_CAP_PROFILING implied by /callcap, /cap, /dlp and /fastcap
/D_CHAR_UNSIGNED implied by /J
/D_CPPRTTI implied by /GR
/D_CPPUNWIND implied by /EHa, /EHs and /GX
/D_DEBUG implied by /LDd, /MDd, /MLd and /MTd
/D_DLL implied by /MD and /MDd
/D_INTEGRAL_MAX_BITS=number implied by /ZB[number] (with number defaulting to 64)
/D_MSC_EXTENSIONS implied by /Ze
/D_MSC_FULL_VER=13009466 initial option
/D_MSC_VER=1300 initial option
/D_MT implied by /LD, /LDd, /MD, /MDd, /MT and /MTd
/D_M_CEE=001 implied by /clr[:noAssembly]
/D_M_IX86=300 implied by /G3
/D_M_IX86=400 implied by /G4
/D_M_IX86=500 implied by /G5
/D_M_IX86=600 implied by /G6 and /GB
/D_WIN32 initial option

Exemptions

The following escape cancellation by /u, possibly by design, but plausibly by accident (specifically that an exclamation mark is omitted from their entries in the relevant table).

/D_Wp64 exempt, though implied by /Wp64
/D__MSVC_RUNTIME_CHECKS exempt, though implied by /GZ, /RTC1, /RTCc, /RTCs and /RTCu

The /clr option, with or without the noAssembly keyword, induces CL to generate a /D_MANAGED option, but as if given explicitly and therefore not subject to /u. Also, if none of the /LD, /LDd, /MD, /MDd, /ML, /MLd, /MT or /MTd options are set explicitly, then /clr (again, with or without the noAssembly keyword) causes CL to generate a /MT option. Though this implies a /D for defining the _MT macro, it happens too late to be subject to /u.

/D_MANAGED exempt, when set in response to /clr[:noAssembly]
/D_MT exempt, when implied by /MT when set in response to /clr[:noAssembly]