gcc options.



$gcc hello.c -o hello
$du -h hello
8.0K hello
$gcc -pg hello.c -o hello
$du -h hello
8.0K hello
$ls -l hello
-rwxr-xr-x 1 7417 Nov 2 05:46 hello
$rm hello
$gcc hello.c -o hello
$ls -l hello
-rwxr-xr-x 1 10093 Nov 2 05:47 hello
$
some content supressed.

The gcc compiler accepts both single-letter options, such as
-o, and multiletter options, such as -ansi. Because it accepts both
types of options you cannot group multiple single-letter options
together as you may be used to doing in many GNU and Unix
/Linux programs. For example, the multiletter option -pg is not
the same as the two single-letter options -p -g. The -pg option
creates extra code in the final binary that outputs profile information
for the GNU code profiler, gprof. On the other hand, the -p -g options
generate extra code in the resulting binary that produces profiling
information for use by the prof code profiler (-p) and causes gcc to
generate debugging information using the operating system’s normal
format (-g).


Reference/Source:
The Definitive Guide to GCC Second Edition
William von Hagen

 

Leave a Reply

Your email address will not be published. Required fields are marked *