GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    Sexy Moon (moon@shitposter.club)'s status on Wednesday, 25-Oct-2023 00:10:15 JST Sexy Moon Sexy Moon
    C > C++
    In conversation Wednesday, 25-Oct-2023 00:10:15 JST from shitposter.club permalink
    • Haelwenn /элвэн/ :triskell:, Doughnut Lollipop 【記録係】:blobfoxgooglymlem: and Pleroma-tan like this.
    • Pleroma-tan repeated this.
    • Embed this notice
      Trash Panda (raccoon@den.raccoon.quest)'s status on Wednesday, 25-Oct-2023 00:11:15 JST Trash Panda Trash Panda
      in reply to

      @Moon@shitposter.club Mathematically impossible since one has plus and the other does not.

      In conversation Wednesday, 25-Oct-2023 00:11:15 JST permalink
      Pleroma-tan likes this.
    • Embed this notice
      Doughnut Lollipop 【記録係】:blobfoxgooglymlem: (tk@bbs.kawa-kun.com)'s status on Wednesday, 25-Oct-2023 00:26:31 JST Doughnut Lollipop 【記録係】:blobfoxgooglymlem: Doughnut Lollipop 【記録係】:blobfoxgooglymlem:
      in reply to

      @Moon What about B?

      In conversation Wednesday, 25-Oct-2023 00:26:31 JST permalink
    • Embed this notice
      :umu: :umu: (a1ba@suya.place)'s status on Wednesday, 25-Oct-2023 00:30:07 JST :umu: :umu: :umu: :umu:
      in reply to
      @Moon true tho.

      C++ std committee is non-stopping printer of bad ideas
      In conversation Wednesday, 25-Oct-2023 00:30:07 JST permalink
      Sexy Moon and :blobancap: :blobcattrans: :blobancap: :blobcattrans: :blobancap: :blobcattrans: like this.
    • Embed this notice
      :umu: :umu: (a1ba@suya.place)'s status on Wednesday, 25-Oct-2023 00:31:43 JST :umu: :umu: :umu: :umu:
      in reply to
      • :suya:
      • :umu: :umu:
      @Moon sure, you can make a subset of C++ like @newt said, but it's either limiting yourself to C++98, either keeping eye that everyone involved does write in that C++ subset because there are no tools to selectively disable C++ features. The closest are static analyzers that can check against MISRA C++ guidelines, but that's it.
      In conversation Wednesday, 25-Oct-2023 00:31:43 JST permalink
      :blobancap: :blobcattrans: :blobancap: :blobcattrans: :blobancap: :blobcattrans: likes this.
    • Embed this notice
      narcolepsy and alcoholism :flag: (hj@shigusegubu.club)'s status on Wednesday, 25-Oct-2023 00:33:01 JST narcolepsy and alcoholism :flag: narcolepsy and alcoholism :flag:
      in reply to
      @Moon false

      because C will be incremented comparison operation completes, not before
      In conversation Wednesday, 25-Oct-2023 00:33:01 JST permalink
      Haelwenn /элвэн/ :triskell: likes this.
    • Embed this notice
      Sexy Moon (moon@shitposter.club)'s status on Wednesday, 25-Oct-2023 01:36:45 JST Sexy Moon Sexy Moon
      in reply to
      • narcolepsy and alcoholism :flag:
      Pretty sure undefined behavior
      In conversation Wednesday, 25-Oct-2023 01:36:45 JST permalink
      narcolepsy and alcoholism :flag: likes this.
    • Embed this notice
      Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Wednesday, 25-Oct-2023 02:30:03 JST Haelwenn /элвэн/ :triskell: Haelwenn /элвэн/ :triskell:
      in reply to
      • narcolepsy and alcoholism :flag:
      @Moon @hj Nah, I'm pretty sure i++ vs. ++i is well defined in C.
      In conversation Wednesday, 25-Oct-2023 02:30:03 JST permalink
    • Embed this notice
      Sexy Moon (moon@shitposter.club)'s status on Wednesday, 25-Oct-2023 02:30:28 JST Sexy Moon Sexy Moon
      in reply to
      • Haelwenn /элвэн/ :triskell:
      • narcolepsy and alcoholism :flag:
      @lanodan @hj I guess we could look
      In conversation Wednesday, 25-Oct-2023 02:30:28 JST permalink
    • Embed this notice
      ロミンちゃん (romin@shitposter.club)'s status on Wednesday, 25-Oct-2023 02:32:53 JST ロミンちゃん ロミンちゃん
      in reply to
      • Haelwenn /элвэн/ :triskell:
      • narcolepsy and alcoholism :flag:

      @Moon @lanodan @hj it’s assigning the increment the one that it’s undefined (i = i++;)

      In conversation Wednesday, 25-Oct-2023 02:32:53 JST permalink
    • Embed this notice
      narcolepsy and alcoholism :flag: (hj@shigusegubu.club)'s status on Wednesday, 25-Oct-2023 02:33:07 JST narcolepsy and alcoholism :flag: narcolepsy and alcoholism :flag:
      in reply to
      • Haelwenn /элвэн/ :triskell:
      @Moon @lanodan the joke is that even if it was c > ++c it would still be false because c is incrementing, not decrementing

      equals though is a different story.

      at least in JS:
      a === ++a
      false
      a === a++
      true
      In conversation Wednesday, 25-Oct-2023 02:33:07 JST permalink
    • Embed this notice
      narcolepsy and alcoholism :flag: (hj@shigusegubu.club)'s status on Wednesday, 25-Oct-2023 02:45:04 JST narcolepsy and alcoholism :flag: narcolepsy and alcoholism :flag:
      in reply to
      • Haelwenn /элвэн/ :triskell:
      • applejack 🇮🇸:hitlergrin2:
      @applejack @lanodan @Moon
      a > ++a === undefined
      false
      In conversation Wednesday, 25-Oct-2023 02:45:04 JST permalink
    • Embed this notice
      applejack 🇮🇸:hitlergrin2: (applejack@gameliberty.club)'s status on Wednesday, 25-Oct-2023 02:45:05 JST applejack 🇮🇸:hitlergrin2: applejack 🇮🇸:hitlergrin2:
      in reply to
      • Haelwenn /элвэн/ :triskell:
      • narcolepsy and alcoholism :flag:

      @hj @lanodan @Moon It's not false or true, it's completely undefined. The rules for sequencing explicitly state that you can only update a variable once between sequence points

      The compiler is allowed to read C into register B, then increment C in place, then read C into register A, and then conclude that A > B

      In conversation Wednesday, 25-Oct-2023 02:45:05 JST permalink
    • Embed this notice
      Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Wednesday, 25-Oct-2023 02:47:38 JST Haelwenn /элвэн/ :triskell: Haelwenn /элвэн/ :triskell:
      in reply to
      • narcolepsy and alcoholism :flag:

      @hj @Moon Meanwhile in reality rather than code: C !== C++
      As C++ is long gone from being a pure superset of C, both evolved in their own ways.

      In conversation Wednesday, 25-Oct-2023 02:47:38 JST permalink
      :blobancap: :blobcattrans: :blobancap: :blobcattrans: :blobancap: :blobcattrans: likes this.
    • Embed this notice
      Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Wednesday, 25-Oct-2023 03:16:49 JST Haelwenn /элвэн/ :triskell: Haelwenn /элвэн/ :triskell:
      in reply to
      • narcolepsy and alcoholism :flag:
      • LEdoian
      @ledoian @hj @Moon Ooh… yeah that part might be.
      And yeah C is a language where clever-code/code-golfing will just result in broken behavior, I don't think I would do a comparaison and an increment at the same time in actual code.
      In conversation Wednesday, 25-Oct-2023 03:16:49 JST permalink
    • Embed this notice
      LEdoian (ledoian@pleroma.ledoian.cz)'s status on Wednesday, 25-Oct-2023 03:16:51 JST LEdoian LEdoian
      in reply to
      • Haelwenn /элвэн/ :triskell:
      • narcolepsy and alcoholism :flag:

      @lanodan @hj @Moon I think the comparison might be actually undefined, since there is no sequence point in that expression, so it is possible that the RHS is evaluated before LHS, thus resulting in true. (Or house fire, given it is UB…)

      One of the favourite gotchas of C… I only remember: when pre-/postincrementing, do not do anything clever like reusing the variable. And I had to check the standard to be at least slightly confident in what I write here.

      In conversation Wednesday, 25-Oct-2023 03:16:51 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.