All command line arguments you supply are interpreted by the compiler (or compiler driver, in the case of some compilers like gcc). They may then be passed on to other programs that the compiler (or compiler driver) executes to complete particular tasks.
Incidentally, -o
is not an optimisation setting with quite a few compilers. It usually specifies the name of an output file. For example, gcc -c file.c -o anotherfile.o
compilers file.c
and produces an object file named anotherfile.o
.
The optimisation setting is usually -O
(for example -O3
). Note the uppercase O
. It won’t necessarily be passed to every program executed by the compiler/driver. For example, gcc -O3 file.c -o program
compiles file.c
with optimisation setting -O3
and produces an output executable named program
. To do that, the linker is invoked, as well as various compilation phases (preprocessor, compiler proper, etc). -O3
will not normally be passed to the linker – it is a compilation option which linkers normally do not understand.
solved Optimization setting