fkeep-static-consts, Qkeep-static-consts

Tells the compiler to preserve allocation of variables that are not referenced in the source.

Syntax

Linux OS and OS X:

-fkeep-static-consts

-fno-keep-static-consts

Windows OS:

/Qkeep-static-consts

/Qkeep-static-consts-

Arguments

None

Default

-fno-keep-static-consts or /Qkeep-static-consts-

If a variable is never referenced in a routine, the variable is discarded unless optimizations are disabled by option -O0 (Linux* OS and OS X*) or /Od (Windows* OS).

Description

This option tells the compiler to preserve allocation of variables that are not referenced in the source.

The negated form can be useful when optimizations are enabled to reduce the memory usage of static data.

IDE Equivalent

None

Alternate Options

None

有关编译器优化的更完整信息,请参阅优化通知