
{"id":46,"date":"2010-11-01T18:44:21","date_gmt":"2010-11-01T13:14:21","guid":{"rendered":"http:\/\/compilerart.org\/?p=46"},"modified":"2010-11-01T18:44:21","modified_gmt":"2010-11-01T13:14:21","slug":"gcc-options","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2010\/11\/01\/gcc-options\/","title":{"rendered":"gcc options."},"content":{"rendered":"<div class=\"img-with-text\">\n <a href=\"http:\/\/www.trueangle.org\/wp-content\/uploads\/2011\/01\/50970-paper1-2.pngwp-content\/uploads\/2010\/11\/gccoption1.png\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/compilerart.org\/wp-content\/uploads\/2010\/11\/gccoption1-300x226.png\" alt=\"\" title=\"gccoption\" width=\"300\" height=\"226\" class=\"alignleft size-medium wp-image-56\" \/><\/a><br \/>\n<code><br \/>\n$gcc hello.c -o hello<br \/>\n$du -h hello<br \/>\n8.0K\thello<br \/>\n$gcc -pg hello.c -o hello<br \/>\n$du -h hello<br \/>\n8.0K\thello<br \/>\n$ls -l hello<br \/>\n-rwxr-xr-x 1   7417 Nov  2 05:46 hello<br \/>\n$rm hello<br \/>\n$gcc hello.c -o hello<br \/>\n$ls -l hello<br \/>\n-rwxr-xr-x 1   6593 Nov  2 05:47 hello<br \/>\n$<br \/>\nsome content supressed.<br \/>\n<\/code>\n<\/div>\n<p class=\"theory\">\nThe gcc compiler accepts both single-letter options, such as<br \/>\n-o, and multiletter options, such as -ansi. Because it accepts both<br \/>\ntypes of options you cannot group multiple single-letter options<br \/>\ntogether as you may be used to doing in many GNU and Unix<br \/>\n\/Linux programs. For example, the multiletter option -pg is not<br \/>\nthe same as the two single-letter options -p -g. The -pg option<br \/>\ncreates extra code in the final binary that outputs profile information<br \/>\nfor the GNU code profiler, gprof. On the other hand, the -p -g options<br \/>\ngenerate extra code in the resulting binary that produces profiling<br \/>\ninformation for use by the prof code profiler (-p) and causes gcc to<br \/>\ngenerate debugging information using the operating system\u2019s normal<br \/>\n format (-g).\n<\/p>\n<p><code><br \/>\nReference\/Source:<br \/>\nThe Definitive Guide to GCC Second Edition<br \/>\nWilliam von Hagen<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>$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 6593 Nov 2 05:47 hello $ some content supressed. The gcc compiler accepts both single-letter &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2010\/11\/01\/gcc-options\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;gcc options.&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/46"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/46\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}