4 comments

  • gavinray46 minutes ago
    I want to point out an implemented feature that people SHOULD be adopting but that I doubt will be picked up:<p><pre><code> P2590R2, Explicit lifetime management (PR106658) </code></pre> This is for &quot;std::start_lifetime_as&lt;T&gt;&quot;. If you have not heard of this before, it&#x27;s the non-UB way to type-pun a pointer into a structured type.<p>Nearly all zero-copy code that deals with external I&#x2F;O buffers looks something like:<p><pre><code> std::unique_ptr&lt;char[]&gt; buffer = stream-&gt;read(); if (buffer[0] == FOO) processFoo(reinterpret_cast&lt;Foo*&gt;(buffer.get())); &#x2F;&#x2F; undefined behavior else processBar(reinterpret_cast&lt;Bar*&gt;(buffer.get())); &#x2F;&#x2F; undefined behaviour </code></pre> With this merged, swap the reinterpret_cast for start_lifetime_as and you&#x27;re no longer being naughty.<p><a href="https:&#x2F;&#x2F;en.cppreference.com&#x2F;cpp&#x2F;memory&#x2F;start_lifetime_as" rel="nofollow">https:&#x2F;&#x2F;en.cppreference.com&#x2F;cpp&#x2F;memory&#x2F;start_lifetime_as</a>
    • groundzeros201542 minutes ago
      You’re allowed to type pun char buffers.
      • jcranmer20 minutes ago
        No, you&#x27;re not.<p>You&#x27;re allowed to access any type via a char buffer. But the converse is not true (quoting <a href="https:&#x2F;&#x2F;eel.is&#x2F;c++draft&#x2F;expr#basic.lval-11" rel="nofollow">https:&#x2F;&#x2F;eel.is&#x2F;c++draft&#x2F;expr#basic.lval-11</a>):<p>&gt; An object of dynamic type Tobj is type-accessible through a glvalue of type Tref if Tref is similar ([conv.qual]) to: Tobj, a type that is the signed or unsigned type corresponding to Tobj, or a char, unsigned char, or std :: byte type. If a program attempts to access ([defns.access]) the stored value of an object through a glvalue through which it is not type-accessible, the behavior is undefined.<p>The dynamic type of a char buffer is, well, a char buffer, and can only be accessed via things that are the same type as a char buffer up to signedness and cv-qualification. The actual strict aliasing rules are not commutative!
      • ozgrakkurt34 minutes ago
        And should always use -fno-strict-aliasing anyways. The default rules are insane
    • throw83494839810 minutes ago
      Your code is not only naughty, it’s also incorrect due to alignment issues.
  • t-31 hour ago
    Somehow I never realized that GCC has a very regular release schedule until looking it up just now: <a href="https:&#x2F;&#x2F;gcc.gnu.org&#x2F;develop.html" rel="nofollow">https:&#x2F;&#x2F;gcc.gnu.org&#x2F;develop.html</a>
    • bluGill47 minutes ago
      Large projects have been going to regular scheduled releases for a long time. Until the 90&#x27;s people thought they could waterfall a large release with all your desired features (and for tiny projects this is still a good idea), but as your projects grow (possibly just to small) you reach a point where someone is always working on a feature that isn&#x27;t ready yet, so a regular release means you still can support your customers with releases. This forces developers who are unsure they will be ready to have some sort of &quot;disabled this unstable feature&quot; toggle, which is about the best you can do.
      • cogman1042 minutes ago
        Yup. OpenJDK is one of the best success stories of this.<p>Up until Java 9, they would release once features were complete. But that meant there were years between the 7 and 8 release and even more years between the 8 and 9 release.<p>The industry had gotten into the habit of always running old versions of Java (my company was on 6 for an uncomfortable amount of time. But others have had it worse).<p>More frequent smaller releases has gotten companies more into the habit of updating frequently which also, very helpfully, gives devs new features frequently.
        • jabl14 minutes ago
          The Linux kernel is another example. The 2.5 development cycle (which led to the stable 2.6 series) was brutally long, and distros resorted to back-porting new features into their own kernels based on the stable 2.4 series that they provided to their users, creating all kinds of excitement. After 2.6.0 was released, Linux basically went nope, not gonna do that again.
    • uyjulian1 hour ago
      It has been that way since people from Cygnus (now RedHat-&gt;IBM) reorganized the project
    • r2vcap1 hour ago
      Yeah, GCC’s recent major releases have been remarkably regular, much like Fedora’s spring releases, and their releases seem to fit into the same broader rhythm. Hint? Red Hat.
    • tosti1 hour ago
      IIRC, since GCC got covered by GPL3.<p>It used to be slower and I&#x27;ve spent way too much time working around C++ bugs in GCC 2.95<p>(The fact that I remember the problematic version is telling :)
      • gpderetta1 hour ago
        Everybody remembers that specific version :). And I wasn&#x27;t even programming professionally at that time!
        • bluGill44 minutes ago
          For many years that was the only version that could be used. What become gcc3 took years. In the end it was better, but for a while gcc 2.95 was the best we had despite the bugs.
      • physicsguy1 hour ago
        They changed their major release numbers too tbf. 4.x it was point release per year, now it&#x27;s a major release per year.
  • xzstas1 hour ago
    I&#x27;ve already been using it for some time (debian sid has a trunk package). it has c++26 reflection, so I already do some magical things with reflection (much better for some cases e.g. for ser-des). I only wish they had a lsp server in their eco-system!
    • klaussilveira1 hour ago
      libstd has been giving me issues running gcc 16 binaries on Debian 12 and 13.
      • gjvc3 minutes ago
        [delayed]
  • dapperdrake38 minutes ago
    Does -Ofast still ignore -fno-fast-math ?