
{"id":8149,"date":"2013-02-13T11:28:50","date_gmt":"2013-02-13T11:28:50","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=8149"},"modified":"2013-02-13T11:28:50","modified_gmt":"2013-02-13T11:28:50","slug":"gcc-commandline-options-part-6","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2013\/02\/13\/gcc-commandline-options-part-6\/","title":{"rendered":"GCC COMMANDLINE OPTIONS PART 6"},"content":{"rendered":"<h4><u>commandline session<\/u><\/h4>\n<pre>\n$ gcc -c -Wall -Werror -fPIC main.c\nmain.c: In function \u2018main\u2019:\nmain.c:8:10: error: \u2018i\u2019 is used uninitialized in this function [-Werror=uninitialized]\ncc1: all warnings being treated as errors\n$vim main.c\n$cat main.c\n#include&lt;stdio.h&gt;\n#include&lt;math.h&gt;\n\nint main(void)\n{\n   float y;\n   printf(\"n The Geek Stuff [%d]n\", i);\n   y=sinf(2.5);\n   printf(\"%fn\",y);\n   return 0;\n}\n$ gcc -c -Wall -Werror -fPIC main.c\nmain.c: In function \u2018main\u2019:\nmain.c:7:39: error: \u2018i\u2019 undeclared (first use in this function)\nmain.c:7:39: note: each undeclared identifier is reported only once for each function it appears in\n$vim main.c\n$cat main.c\n#include\n#include\n\nint main(void)\n{\n int i=0;\n   float y;\n   printf(\"n The Geek Stuff [%d]n\", i);\n   y=sinf(2.5);\n   printf(\"%fn\",y);\n   return 0;\n}\n$ gcc -c -Wall -Werror -fPIC main.c\n$ls main.o\nmain.o\n$rm main.o\n$ gcc -c -Wall -Werror -fPIC main.c\n$ls main.o\nmain.o\n$gcc -shared -o libmain.so main.o\n$ldd libmain.so\n\tlinux-vdso.so.1 =&gt;  (0x00007fffbbc64000)\n\tlibc.so.6 =&gt; \/lib\/x86_64-linux-gnu\/libc.so.6 (0x00007f74b1bfe000)\n\t\/lib64\/ld-linux-x86-64.so.2 (0x00007f74b21b4000)\n$\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>commandline session $ gcc -c -Wall -Werror -fPIC main.c main.c: In function \u2018main\u2019: main.c:8:10: error: \u2018i\u2019 is used uninitialized in this function [-Werror=uninitialized] cc1: all warnings being treated as errors $vim main.c $cat main.c #include&lt;stdio.h&gt; #include&lt;math.h&gt; int main(void) { float y; printf(&#8220;n The Geek Stuff [%d]n&#8221;, i); y=sinf(2.5); printf(&#8220;%fn&#8221;,y); return 0; } $ gcc -c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2013\/02\/13\/gcc-commandline-options-part-6\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;GCC COMMANDLINE OPTIONS PART 6&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","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\/8149"}],"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=8149"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/8149\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=8149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=8149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=8149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}