{"id":34,"date":"2015-07-12T13:45:53","date_gmt":"2015-07-12T12:45:53","guid":{"rendered":"http:\/\/watchdiana.fail\/blog\/?p=34"},"modified":"2015-07-12T13:45:53","modified_gmt":"2015-07-12T12:45:53","slug":"learn-c-the-hard-way-arch-is-a-bastard-for-this-and-im-fine-with-that","status":"publish","type":"post","link":"https:\/\/watchdiana.fail\/blog\/2015\/07\/12\/learn-c-the-hard-way-arch-is-a-bastard-for-this-and-im-fine-with-that\/","title":{"rendered":"Learn C the Hard Way &#8211; Arch is a bastard for this and I&#8217;m fine with that"},"content":{"rendered":"<p>Ex 4.<\/p>\n<p>Valgrind is available in the \/extra repository in Arch.  We&#8217;re going to make it ourselves, though.  Fair enough.  I&#8217;ve made a few packages as far as I recall, but not in a while.  When I was initially setting up my machine, inkscape wasn&#8217;t so good and I was using inkscape-bzr and now I don&#8217;t need that any more.<\/p>\n<pre>$ tar -xf &lt;FILE&gt;<\/pre>\n<p> is enough to unpack most things.  &#8216;eXtract File&#8217;.  The tool will work out what sort of file it&#8217;s working on and just does it.<\/p>\n<pre>$ .\/configure<\/pre>\n<p> &#8211; error.  Valgrind works on kernels 2.4 and 2.6 &#8211; Arch is a rolling release.  I&#8217;m on kernel 4.something.  Soooo.  Package manager it is.  At some point I&#8217;ll need to work out what about the package has been changed to make it work in Arch.  The README.aarch has instructions on cross-compiling and paths and hosts which have a shape that makes sense but I&#8217;m not looking at the detail.  I&#8217;ve used pacman and I have valgrind on the system.  I stared at the Makefiles that my attempt generated, though, in the hope of absorbing their strength by drooling.  On with the lesson.<\/p>\n<p>The output of valgrind is already similar to Zed&#8217;s, but at some point I may diverge &#8211; Arch is like that.  For now, though, I&#8217;m getting error tracking.<\/p>\n<p>By fixing the uninitialised variable in ex 4, I fix all the actual errors.  This is odd, as valgrind doesn&#8217;t pick up the %d without a related integer, in the first printf function.  I can&#8217;t see why that might be in the manual.  However, I know what the program should say, so I know what to fix.  An uninitialised variable is an error that could lead to unexpected problems, and valgrind picks it up.  A variable that&#8217;s missing could lead to, well, also unexpected problems.  But valgrind doesn&#8217;t pick it up.  Odd.  Maybe an Arch thing but I don&#8217;t think so.  It was not there in Zed&#8217;s print-out either.<\/p>\n<p>The compiler tells me what the other problem is, so I&#8217;ll deal with that.  Variables are now initialised and don&#8217;t go unused, and all format sequences are filled.<\/p>\n<p>I did some messing about with making downloaded packages, but I&#8217;ve got to look into Arch&#8217;s installation process to really understand that.  pacman is a powerful tool, and like all powerful tools, it hates me right from the off.  I know I can make a package and then have pacman install it from my local file, but for now I&#8217;m not using that.  Onward, upward, and avoid the Pevensey children on the way.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ex 4. Valgrind is available in the \/extra repository in Arch. We&#8217;re going to make it ourselves, though. Fair enough. I&#8217;ve made a few packages as far as I recall, but not in a while. When I was initially setting up my machine, inkscape wasn&#8217;t so good and I was using inkscape-bzr and now I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[7,9,2,10,11,13],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-coding","tag-c","tag-coding","tag-failing-is-fun","tag-fun-with-arch-linux","tag-learn-c-the-hard-way","tag-things-i-do-because-im-stubborn","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/watchdiana.fail\/blog\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/watchdiana.fail\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/watchdiana.fail\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/watchdiana.fail\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/watchdiana.fail\/blog\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":0,"href":"https:\/\/watchdiana.fail\/blog\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"wp:attachment":[{"href":"https:\/\/watchdiana.fail\/blog\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/watchdiana.fail\/blog\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/watchdiana.fail\/blog\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}