fkeep-static-consts, Qkeep-static-consts

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

IDE Equivalent

None

Architectures

IA-32 architecture, Intel® 64 architecture, IA-64 architecture

Syntax

Linux and Mac OS: -fkeep-static-consts
-fno-keep-static-consts
Windows:  /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 and Mac OS) or /Od (Windows).

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.

Alternate Options

None