save-temps, Qsave-temps

Tells the compiler to save intermediate files created during compilation.

IDE Equivalent

None

Architectures

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

Syntax

Linux and Mac OS: -save-temps
-no-save-temps
Windows:  /Qsave-temps
/Qsave-temps-

Arguments

None

Default

Linux and Mac OS: –no-save-temps
Windows: .obj files are saved
On Linux and Mac OS systems, the compiler deletes intermediate files after compilation is completed. On Windows systems, the compiler saves only intermediate object files after compilation is completed.

Description

This option tells the compiler to save intermediate files created during compilation. The names of the files saved are based on the name of the source file; the files are saved in the current working directory.

If -save-temps or /Qsave-temps is specified, the following occurs:

If -no-save-temps is specified on Linux or Mac OS systems, the following occurs:

If /Qsave-temps- is specified on Windows systems, the following occurs:

Note

This option only saves intermediate files that are normally created during compilation.

Alternate Options

None

Example

If you compile program my_foo.c on a Linux or Mac OS system and you specify option -save-temps and option -use-asm, the compilation will produce files my_foo.o and my_foo.s.

If you compile program my_foo.c on a Windows system and you specify option /Qsave-temps and option /Quse-asm, the compilation will produce files my_foo.o and my_foo.asm.