• Kwdg
      link
      fedilink
      arrow-up
      28
      arrow-down
      1
      ·
      3 months ago

      Not needed, main in C++ implicitly returns 0 if there is no return

      • Lucy :3@feddit.org
        link
        fedilink
        arrow-up
        9
        arrow-down
        9
        ·
        3 months ago

        Should ≠ Needs to

        You can do it, and it will work, but it’s unclean and not best-practice. I wouldn’t be surprised if it’s undefined behaviour.

        • xmunk@sh.itjust.works
          link
          fedilink
          arrow-up
          22
          ·
          3 months ago

          Just to clarify. It is defined behavior - there’s plenty of undefined behavior in C but that ain’t one of them.

    • esa
      link
      fedilink
      arrow-up
      23
      arrow-down
      2
      ·
      3 months ago

      >What is C++? A miserable huge pile of "should"s

      • Fonzie!@ttrpg.network
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        And sensible compile times.

        I’m trying to write a game in Bevy but my laptop’s Intel 7400 taking almost a minute to compile even small changes is really killing me.
        I’ve looked up rustc compile times on different CPUs and am seriously considering getting a new laptop with a Snapdragon X Elite or something in that vein for this.