‹ BackHN Continuity

Thread

Type Punning in C and C++

36 points · 23 comments · ingve

  1. eqvinox · · focus · HN ↗
    The example included below "Why C and C++ Differ" is UB in both C and C++ (and says nothing about "why" C & C++ differ). The article isn't overall wrong but that bit is just...

    (Feels a bit like LLM junk, but honestly not sure.)

    1. LoganDark · · focus · HN ↗
      > A pointer cast worked fine at -O0 and silently broke at -O2.

      Feels like LLM to me. I looked at some of the rest of the article and... pretty much certain now.

    2. rfgplk · · focus · HN ↗
      > (Feels a bit like LLM junk, but honestly not sure.)

      Why leave such disparaging comments?

      1. munificent · · focus · HN ↗
        Because if the comment is correct, it's useful signal for other potential readers to know that they can skip it.

        I try to be as charitable as possible when reading and commenting online, but we don't have infinite attention and thanks to AI, it's easier than ever to end up wasting it on things that aren't worth reading.

        (I'm not claiming that the article here is or is not an example of that.)

      2. quietbritishjim · · focus · HN ↗
        Even if it's not from an LLM, it's still wrong! You've focused on the last important of that comment, really.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.