{"id":92,"date":"2012-11-17T15:35:33","date_gmt":"2012-11-17T13:35:33","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=92"},"modified":"2013-01-12T12:22:59","modified_gmt":"2013-01-12T10:22:59","slug":"how-g0-may-be-useful","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2012\/11\/17\/how-g0-may-be-useful\/","title":{"rendered":"How -g0 may be useful"},"content":{"rendered":"<p>Usually I use -g0 as <em>CFLAGS\/CXXFLAGS<\/em>; it will be useful to find wrong buildsystem behavior.<br \/>\n<code>ago@arcadia ~ $ portageq envvar CFLAGS<br \/>\n-march=native -O2 -g0<\/code><\/p>\n<p>Here is an example where the buildsystem sed only &#8216;<em>-g<\/em>&#8216;, leaves &#8216;<em>0<\/em>&#8216; and causes compile failure:<\/p>\n<p><code>x86_64-pc-linux-gnu-gcc -DNDEBUG -march=native -O2 0 -m64 -O3 -Wall -DREGINA_SHARE_DIRECTORY=\\\"\/usr\/share\/regina\\\" -DREGINA_VERSION_DATE=\\\"\"31 Dec 2011\"\\\" -DREGINA_VERSION_MAJOR=\\\"3\\\" -DREGINA_VERSION_MINOR=\\\"6\\\" -DREGINA_VERSION_SUPP=\\\"\\\" -DHAVE_CONFIG_H -DHAVE_GCI -I.\/gci -I. -I. -I.\/contrib -o funcs.o -c .\/funcs.c<br \/>\n<strong>x86_64-pc-linux-gnu-gcc: 0: No such file or directory<\/strong><br \/>\n.\/funcs.c: In function '__regina_convert_date':<br \/>\n.\/funcs.c:772:14: warning: array subscript is above array bounds<br \/>\nmake: *** [funcs.o] Error 1<br \/>\nemake failed<\/code><\/p>\n<p>So add it to your <em>CFLAGS\/CXXFLAGS<\/em> may be a good idea.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Usually I use -g0 as CFLAGS\/CXXFLAGS; it will be useful to find wrong buildsystem behavior. ago@arcadia ~ $ portageq envvar CFLAGS -march=native -O2 -g0 Here is an example where the buildsystem sed only &#8216;-g&#8216;, leaves &#8216;0&#8216; and causes compile failure: &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2012\/11\/17\/how-g0-may-be-useful\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":140,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4,3],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2EaBc-1u","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/92"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/users\/140"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/comments?post=92"}],"version-history":[{"count":11,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":145,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/92\/revisions\/145"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}