Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • Does -Ofast still ignore -fno-fast-math ?
  • Noob question - Does gcc use LLVM anywhere under the hood or it has its own code generation and optimization pipeline? How does it stack in comparison to LLVM?
    by wg0
  • I tried the unstable sources for a while, in the last ~3 months. I ran into some issues with some programs (could not compile them with recent GCC, but older GCC worked fine), so gcc 15.x works better for me in general (presently) - but from, say, +3000 programs to compile, the vast majority works well, and a few may need patches (which can often be found in LFS/BLFS by the way, they often use sed instructions to fix individual things and then it works usually).

    Hopefully they fixed those issues. We all need stability and things-to-work.

  • > The so-called "json" format for -fdiagnostics-format= has been removed in this release. Users seeking machine-readable diagnostics from GCC should use SARIF.

    But:

    > GCC can now output diagnostics in HTML form via -fdiagnostics-add-output=experimental-html

    I wonder what drove the decision to remove JSON output and add HTML output?

  • I'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!
  • Somehow I never realized that GCC has a very regular release schedule until looking it up just now: https://gcc.gnu.org/develop.html
    by t-3
  • I want to point out an implemented feature that people SHOULD be adopting but that I doubt will be picked up:

      P2590R2, Explicit lifetime management (PR106658)
    
    This is for "std::start_lifetime_as<T>". If you have not heard of this before, it's the non-UB way to type-pun a pointer into a structured type.

    Nearly all zero-copy code that deals with external I/O buffers looks something like:

      std::unique_ptr<char[]> buffer = stream->read();
      if (buffer[0] == FOO)
        processFoo(reinterpret_cast<Foo*>(buffer.get())); // undefined behavior
      else
        processBar(reinterpret_cast<Bar*>(buffer.get())); // undefined behaviour
    
    With this merged, swap the reinterpret_cast for start_lifetime_as and you're no longer being naughty.

    https://en.cppreference.com/cpp/memory/start_lifetime_as

Explore Birbla archives