<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: 0x09</title><link>https://news.ycombinator.com/user?id=0x09</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Thu, 29 Oct 2026 22:34:24 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=0x09" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by 0x09 in "Why is int in C in practice at least a 32 bit?"]]></title><description><![CDATA[
<p>It's partly an artifact of BCPL where the only type was one representing the machine word. So with a word-sized type you don't get portability in the range of values the type can represent, but can portably know that you won't e.g. take up 2 registers by using it.<p>You might consider the int_fastN_t types a sort of spiritual successor to this with fewer downsides since they purposefully guarantee a minimum width.</p>
]]></description><pubDate>Fri, 10 Nov 2023 02:00:32 +0000</pubDate><link>https://news.ycombinator.com/item?id=38214186</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=38214186</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=38214186</guid></item><item><title><![CDATA[New comment by 0x09 in "C’s Biggest Mistake (2009)"]]></title><description><![CDATA[
<p>>Can be macro'd at the function definition, but it's ugly.<p>I wonder if typeof in c23 has changed this at all. Previously there was no sense in defining an anonymous struct as a function's return type. You could do it, but those structs would not be compatible with anything. With typeof maybe that's no longer the case.<p>e.g. with clang 16 and gcc 13 at least this compiles with no warning and g() returns 3. But I'm not sure if this is intended by the standard or just happens to work.<p><pre><code>    struct { int a; int b; } f() {
        return (typeof(f())){1,2};
    }
    int g() {
        typeof(f()) x = f();
        return x.a + x.b;
    }
</code></pre>
edit: though I suppose this just pushes the problem onto callers, since every function that does this now has a distinct return type that can only be referenced using typeof(yourfn).</p>
]]></description><pubDate>Mon, 03 Jul 2023 01:25:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=36567623</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=36567623</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=36567623</guid></item><item><title><![CDATA[New comment by 0x09 in "sqlean: A set of SQLite extensions"]]></title><description><![CDATA[
<p>I'm the author of the extension that the vtab and define function in that module were adapted from. It allows you to create something like a parameterized view, but the way it works is fairly simple: a prepared statement is created from the provided SQL on the same db connection as the vtab, and is executed each time the virtual table is queried. Parameters can be supplied as constraints (or using table valued function syntax) and the results of executing the statement are the row values.<p>Did you have any questions in particular?</p>
]]></description><pubDate>Wed, 01 Mar 2023 04:45:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=34978871</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=34978871</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=34978871</guid></item><item><title><![CDATA[New comment by 0x09 in "GitHub-Next"]]></title><description><![CDATA[
<p>Doxygen has the ability to generate these with its CALL_GRAPH/CALLER_GRAPH config, at least from each function individually. It can look quite funny when the depth isn't limited: <a href="https://i.imgur.com/3LMV71N.png" rel="nofollow">https://i.imgur.com/3LMV71N.png</a></p>
]]></description><pubDate>Fri, 26 Aug 2022 20:03:35 +0000</pubDate><link>https://news.ycombinator.com/item?id=32612104</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=32612104</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=32612104</guid></item><item><title><![CDATA[New comment by 0x09 in "The ideology hiding in SimCity’s black box"]]></title><description><![CDATA[
<p>Something of an informal reverse engineering of SimCity 3000 existed in sc3000.com's Knowledge Neighborhood. The original site is only partially available via the wayback machine now, though fortunately the articles have been preserved albeit in a slightly less convenient format here <a href="https://community.simtropolis.com/profile/157989-catty-cb/content/?type=cms_records1" rel="nofollow">https://community.simtropolis.com/profile/157989-catty-cb/co...</a><p>The site contained a pretty amazingly comprehensive detailing of the game's mechanics and various algorithms scattered throughout the articles, to the point where it seemed to me like it'd be possible to implement a lot of the game's engine using it.<p>Some good examples of the more detailed articles:<p>The economy <a href="https://community.simtropolis.com/omnibus/other-games/the-economy-r452/" rel="nofollow">https://community.simtropolis.com/omnibus/other-games/the-ec...</a><p>Land value specifics <a href="https://community.simtropolis.com/omnibus/other-games/land-value-specifics-r453/" rel="nofollow">https://community.simtropolis.com/omnibus/other-games/land-v...</a><p>Traffic and transportation specifics <a href="https://community.simtropolis.com/omnibus/other-games/traffic-and-transportation-specifics-r447/" rel="nofollow">https://community.simtropolis.com/omnibus/other-games/traffi...</a><p>Zone development rules <a href="https://community.simtropolis.com/omnibus/other-games/zone-development-rules-r468/" rel="nofollow">https://community.simtropolis.com/omnibus/other-games/zone-d...</a></p>
]]></description><pubDate>Sun, 04 Apr 2021 07:30:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=26687574</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=26687574</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=26687574</guid></item><item><title><![CDATA[New comment by 0x09 in "Pointers Are Complicated, Or: What's in a Byte? (2018)"]]></title><description><![CDATA[
<p>This and Annex J.2 Undefined Behavior and Annex L.3 Analyzability Requirements both also specifically include:
"The value of a pointer that refers to space deallocated by a call to the free or realloc function is used (7.22.3)."</p>
]]></description><pubDate>Sun, 06 Sep 2020 00:46:37 +0000</pubDate><link>https://news.ycombinator.com/item?id=24388011</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=24388011</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=24388011</guid></item><item><title><![CDATA[New comment by 0x09 in "Pointers Are Complicated, Or: What's in a Byte? (2018)"]]></title><description><![CDATA[
<p>The article doesn't touch on this, but in C pointer types are also the only kind that can be invalidated without any apparent change to their value:<p><pre><code>  void *x = malloc(...);
  free(x);
  if(x); // undefined behavior
</code></pre>
Note that this isn't about dereferencing x after free, which is understandably not valid. Rather the standard specifies that <i>any</i> use of the pointer's value itself is undefined after being used as an argument to free, even though syntactically free could not have altered that.<p>This special behavior is also specifically applied to FILE* pointers after fclose() has been called on them.<p>If there is some historical reason / architecture that could explain this part of the specification I would be interested to hear the rationale, this has been present in mostly the same wording since C89.</p>
]]></description><pubDate>Sat, 05 Sep 2020 23:23:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=24387645</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=24387645</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=24387645</guid></item><item><title><![CDATA[New comment by 0x09 in "GCC 10.1 Released"]]></title><description><![CDATA[
<p>Though scan-build is usually the simpler option, clang itself does have an --analyze flag which writes analysis results in various formats, including the same html reports that scan-build would generate. But to see this on standard out<p><pre><code>   clang --analyze --analyzer-output text ...
</code></pre>
Will print the entire analysis tree in the same format as regular diagnostics.</p>
]]></description><pubDate>Fri, 08 May 2020 00:33:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=23110034</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=23110034</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=23110034</guid></item><item><title><![CDATA[New comment by 0x09 in "Tell HN: C Experts Panel – Ask us anything about C"]]></title><description><![CDATA[
<p>Not about the language exactly, so maybe not fair game, but: how did you all find yourselves joining ISO? And maybe more generally, what's the path for someone like a regular old software engineer to come to participate in the standardization process for something as significant and ubiquitous as the C programming language?</p>
]]></description><pubDate>Tue, 14 Apr 2020 13:46:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=22865865</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=22865865</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22865865</guid></item><item><title><![CDATA[New comment by 0x09 in "Lambdas for C – sort of"]]></title><description><![CDATA[
<p>Apple did submit a proposal based on the then-new blocks extension in 2010: <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1451.pdf" rel="nofollow">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1451.pdf</a><p>There was an analysis of this and the C++11 lambda specification done shortly after at <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1483.htm" rel="nofollow">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1483.htm</a>, but it was inconclusive and there doesn't seem to have been any followup since then.</p>
]]></description><pubDate>Thu, 12 Sep 2019 00:27:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=20946277</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=20946277</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=20946277</guid></item><item><title><![CDATA[Ask HN: Resources for First Time Acquisitions]]></title><description><![CDATA[
<p>A friend has been tasked with orchestrating the merger between two similar (small, together bordering on mid-size) competitors. The actual terms of the deal have already been scoped out by the respective CEOs; what's left is really everything else. Are there any good resources or pieces of insight the HN community can offer for someone, and a company as a whole, going through this for the first time? I understand that this is an extremely broad question, but I guess specifically outside of general learning materials, things from your experience that went right or maybe more importantly terribly wrong would all be helpful, even if these may be different every time.<p>To be clear, this question is coming from the perspective of the acquirer, but perspective from the other side seems equally if not more valuable here.</p>
<hr>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=20114756">https://news.ycombinator.com/item?id=20114756</a></p>
<p>Points: 2</p>
<p># Comments: 0</p>
]]></description><pubDate>Thu, 06 Jun 2019 14:15:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=20114756</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=20114756</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=20114756</guid></item><item><title><![CDATA[New comment by 0x09 in "A little-known C feature: Static array indices in parameter declarations (2013)"]]></title><description><![CDATA[
<p>I like using pointer-to-array types for this purpose as (like an array in struct) the array's length is encoded in the type, and thus likewise allows the compiler to warn if an incompatible array is provided.
e.g.<p><pre><code>   void f(char (*n)[255]);
   char array[6];
   f(&array);
</code></pre>
warns of "incompatible pointer types passing 'char (* )[6]' to parameter of type 'char (* )[255]'"<p>This won't produce a diagnostic for f(NULL) like "static" does, but does have two properties that might be considered benefits:<p>1) The length is exact rather than a minimum.<p>2) The type of "* n" is still char[255], whereas a char[static 255] parameter is still a decayed pointer-to-char. Thus with the former sizeof(* n) behaves as expected inside of "f", yielding 255.<p>These are true of the array-in-struct method as well.</p>
]]></description><pubDate>Sun, 30 Dec 2018 04:32:33 +0000</pubDate><link>https://news.ycombinator.com/item?id=18787404</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=18787404</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=18787404</guid></item><item><title><![CDATA[New comment by 0x09 in "C2x: the next real revision of the C standard"]]></title><description><![CDATA[
<p>The linked discussion on the memory model is particularly interesting to me as it covers a number of issues and ambiguities with the current specification for strict aliasing and what kind of accesses should/shouldn't be allowed, including for example the problem that there's no way to obtain untyped space on the stack (Q75).<p>Since this as a whole is among the least consistently implemented and (arguably based on the number of questions it generates) least well understood aspects of the standard it's nice to see some authoritative efforts to clarify the intended behaviors.<p><a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2294.htm" rel="nofollow">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2294.htm</a></p>
]]></description><pubDate>Mon, 12 Nov 2018 14:24:29 +0000</pubDate><link>https://news.ycombinator.com/item?id=18432729</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=18432729</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=18432729</guid></item><item><title><![CDATA[New comment by 0x09 in "The End of Video Coding?"]]></title><description><![CDATA[
<p>This is known as scalable coding and has been included as an extension or profile in at least every ISO and ITU standard since MPEG-2, see for example <a href="https://en.wikipedia.org/wiki/Scalable_Video_Coding" rel="nofollow">https://en.wikipedia.org/wiki/Scalable_Video_Coding</a> (this article seems to be specific to H.264)</p>
]]></description><pubDate>Wed, 13 Jun 2018 22:52:16 +0000</pubDate><link>https://news.ycombinator.com/item?id=17307695</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=17307695</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=17307695</guid></item><item><title><![CDATA[New comment by 0x09 in "A Tutorial on Portable Makefiles"]]></title><description><![CDATA[
<p>Putting the logic into a more flexible configure script that generates definitions for your Makefile and imitates the autotools build process without actually using autotools is a good/obvious compromise. Even some large projects like FFmpeg and mplayer/mpv do this.</p>
]]></description><pubDate>Sun, 20 Aug 2017 21:56:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=15060443</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=15060443</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=15060443</guid></item><item><title><![CDATA[New comment by 0x09 in "A Tutorial on Portable Makefiles"]]></title><description><![CDATA[
<p>The problem comes in as soon as you need conditionals, which is likely when attempting to build something portably. There may be some gymnastics that can be done to write around the lack of their presence in standard make, but otherwise your options are:<p>- Supply multiple makefiles targeting different implementations<p>- Bring in autotools in all its glory (at this point you are depending on an external GNU package anyway)<p>- Or explicitly target GNU Make, which is the default make on Linux and macOS, is very commonly used on *BSD, and is almost certainly portable to every platform your software is going to be tested and run on. The downside being that BSD users need a heads up before typing "make" to build your software. But speaking as a former FreeBSD user, this is pretty easy to figure out after your first time seeing the flood of syntax errors.</p>
]]></description><pubDate>Sun, 20 Aug 2017 21:02:21 +0000</pubDate><link>https://news.ycombinator.com/item?id=15060240</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=15060240</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=15060240</guid></item><item><title><![CDATA[New comment by 0x09 in "Flang – A Fortran compiler targeting LLVM"]]></title><description><![CDATA[
<p>Apparently unrelated to Flang the 2013 LLVM GSOC project to implement a Fortran frontend.<p><a href="https://github.com/hyp/flang" rel="nofollow">https://github.com/hyp/flang</a><p>The name re-use was a bit confusing.</p>
]]></description><pubDate>Fri, 19 May 2017 01:59:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=14372512</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=14372512</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=14372512</guid></item><item><title><![CDATA[New comment by 0x09 in "strncpy() is not a safer strcpy() (2012)"]]></title><description><![CDATA[
<p>The code copies the origin string up to and including the null terminator, which must exist as strlen was used to obtain the size.</p>
]]></description><pubDate>Sat, 29 Apr 2017 18:52:09 +0000</pubDate><link>https://news.ycombinator.com/item?id=14228099</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=14228099</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=14228099</guid></item><item><title><![CDATA[New comment by 0x09 in "Apple releases a bit of code to let you put Live Photos on your sites"]]></title><description><![CDATA[
<p>> You can't just have an mp4 (well, x264) file because that's patent-troubled.<p>This was true of gif until the mid 2000s, well after it became popular.</p>
]]></description><pubDate>Mon, 24 Apr 2017 00:35:01 +0000</pubDate><link>https://news.ycombinator.com/item?id=14181221</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=14181221</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=14181221</guid></item><item><title><![CDATA[New comment by 0x09 in "Historian: Because Please Stop Deleting My Bash History"]]></title><description><![CDATA[
<p>Looking at the script, it doesn't write any history itself, it just loads whatever is in the existing .bash_history into its db when `hist import` is invoked (when a new shell is started if you add it to your .profile like the readme recommends.)<p>So this does not do anything to manage different sessions clobbering each others' histories. The solution posted by zootboy will work together with this script however.</p>
]]></description><pubDate>Thu, 13 Apr 2017 04:14:31 +0000</pubDate><link>https://news.ycombinator.com/item?id=14104119</link><dc:creator>0x09</dc:creator><comments>https://news.ycombinator.com/item?id=14104119</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=14104119</guid></item></channel></rss>