Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

fkeep-static-consts, Qkeep-static-consts

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

Syntax

Linux:

-fkeep-static-consts

-fno-keep-static-consts

macOS:

-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 macOS) 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.

IDE Equivalent

None

Alternate Options

None