home.social

#integeroverflow — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #integeroverflow, aggregated by home.social.

fetched live
  1. This unblocks something on my to-do list! Detecting and dealing with in C is a mild ball-ache and so I've been using that as my excuse to procrastinate. 2/n

  2. This unblocks something on my to-do list! Detecting and dealing with #IntegerOverflow in C is a mild ball-ache and so I've been using that as my excuse to procrastinate. 2/n

  3. 🎩✨ Oh joy, yet another riveting exploration of integer overflow checks – because who wouldn't want to dive into the thrilling world of compiler flags and conditional branches? 🤔🔍 Surely, decoding a branch on #x86 is everyone's idea of a fun-filled weekend! 😂🚀
    danluu.com/integer-overflow/ #integeroverflow #compilerflags #programminghumor #technews #softwaredevelopment #HackerNews #ngated

  4. 🎩✨ Oh joy, yet another riveting exploration of integer overflow checks – because who wouldn't want to dive into the thrilling world of compiler flags and conditional branches? 🤔🔍 Surely, decoding a branch on #x86 is everyone's idea of a fun-filled weekend! 😂🚀
    danluu.com/integer-overflow/ #integeroverflow #compilerflags #programminghumor #technews #softwaredevelopment #HackerNews #ngated

  5. CW: Integer overflow

    Integer overflow! Integer overflow!

    The battery is labeled 44Ah.

    The charger shows -24534 mAh.

    Assuming this thing uses an int16 to store the charged capacity its now at 41 Ah charged, which is totally fine for a "dead, to be scrapped" car battery.

    (Yes I am doing silly off-grid stuff again)

    #integeroverflow

  6. CW: Integer overflow

    Integer overflow! Integer overflow!

    The battery is labeled 44Ah.

    The charger shows -24534 mAh.

    Assuming this thing uses an int16 to store the charged capacity its now at 41 Ah charged, which is totally fine for a "dead, to be scrapped" car battery.

    (Yes I am doing silly off-grid stuff again)

  7. @hywan gcc is not wrong though. You need to check upfront with a decent bounds check that what you will do is OK in C, rather than do it, then see if something undefined happened.

    Unfortunately there weren't good tools in the C or C++ stdlib to do checking for a long time.

    For C++: learn.microsoft.com/en-us/cpp/

    C from c23 has builtins to do this, and each common compiler does too:
    stackoverflow.com/questions/19

  8. @hywan gcc is not wrong though. You need to check upfront with a decent bounds check that what you will do is OK in C, rather than do it, then see if something undefined happened.

    Unfortunately there weren't good tools in the C or C++ stdlib to do checking for a long time.

    For C++: learn.microsoft.com/en-us/cpp/

    C from c23 has builtins to do this, and each common compiler does too:
    stackoverflow.com/questions/19

    #IntegerOverflow #UndefinedBehavior #C #CPP