{"id":472,"date":"2012-09-28T14:25:47","date_gmt":"2012-09-28T14:25:47","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=472"},"modified":"2012-09-28T14:25:47","modified_gmt":"2012-09-28T14:25:47","slug":"c-print-pointers-correctly","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=472","title":{"rendered":"C print pointers correctly"},"content":{"rendered":"<p><a href=\"http:\/\/stackoverflow.com\/questions\/1255099\/whats-the-proper-use-of-printf-to-display-pointers-padded-with-0s\">What&#8217;s the proper use of printf to display pointers padded with 0s<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n#include &lt;inttypes.h&gt;\r\n#include &lt;stdint.h&gt;\r\n\r\nprintf(&quot;0x%012&quot; PRIxPTR &quot;\\n&quot;, (uintptr_t) ptr);\r\n<\/pre>\n<pre class=\"brush: plain; title: Falsch!; notranslate\" title=\"Falsch!\">\r\n\r\nprintf(&quot;%012p&quot;, ptr);\r\nwarning: '0' flag used with \u2018%p\u2019 gnu_printf format &#x5B;-Wformat]\r\n\r\nprintf(&quot;0x%012X&quot;, ptr);\r\nwarning: format \u2018%X\u2019 expects argument of type \u2018unsigned int\u2019, but argument 3 has type \u2018XXX\u2019 &#x5B;-Wformat]\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>What&#8217;s the proper use of printf to display pointers padded with 0s #include &lt;inttypes.h&gt; #include &lt;stdint.h&gt; printf(&quot;0x%012&quot; PRIxPTR &quot;\\n&quot;, (uintptr_t) ptr); printf(&quot;%012p&quot;, ptr); warning: &#8216;0&#8217; flag used with \u2018%p\u2019 gnu_printf format &#x5B;-Wformat] printf(&quot;0x%012X&quot;, ptr); warning: format \u2018%X\u2019 expects argument of type \u2018unsigned int\u2019, but argument 3 has type \u2018XXX\u2019 &#x5B;-Wformat]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","category-operation-systems"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=472"}],"version-history":[{"count":3,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":475,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/472\/revisions\/475"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}