CppCon 2017: John Regehr “Undefined Behavior in 2017 (part 1 of 2)”

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ย. 2024

ความคิดเห็น • 12

  • @annazolkieve9235
    @annazolkieve9235 4 ปีที่แล้ว

    Excellent informative talk describing details of the UB! Very useful! Many thanks!

  • @Kobold666
    @Kobold666 2 หลายเดือนก่อน

    sizeof(int) is equal to sizeof(long) no matter if it's a 32bit or 64bit architecture. They changed int from 16bit to 32bit, but never to 64bit.

  • @gubgubbubbub
    @gubgubbubbub 5 หลายเดือนก่อน

    Excellent speaker and content!

  • @hl2mukkel
    @hl2mukkel 7 ปีที่แล้ว +1

    Fantastic talk, highly interesting!

  • @rafalmichalski4893
    @rafalmichalski4893 4 ปีที่แล้ว +1

    Is it possible to have UB during compile time (assuming no compile errors) ?

  • @cocomonkilla
    @cocomonkilla 5 ปีที่แล้ว +1

    Awesome lecture

  • @thought2007
    @thought2007 7 ปีที่แล้ว +3

    9:12 - Why can't the Standard just say "this is implementation-defined"? The example explains UB vs. defined, but doesn't explain the advantage of undefined vs. implementation-defined.

    • @Zeturic
      @Zeturic 5 ปีที่แล้ว +1

      Because UB isn't just at the language level. An architecture could exist where shifting too far is undefined, even at the hardware level. By listing it as implementation-defined rather than undefined behavior, C/C++ implementations on that architecture would be forced to add to gracefully handle that case in software every time there's a shift.

  • @BillyONeal
    @BillyONeal 7 ปีที่แล้ว +3

    The memcpy example is the standard being stupid. We should fix that.

    • @BillyONeal
      @BillyONeal 7 ปีที่แล้ว +1

      _moonPtr 1. I mean it should be fixed in C.
      2. Allowing more things doesn't break backcompat anyway.

  • @omfgbunder2008
    @omfgbunder2008 5 ปีที่แล้ว

    Shouldn't 32bit

  • @n3whous3
    @n3whous3 5 ปีที่แล้ว

    Wouldn't be better to write the subtitles with somebody who is in the business? "Valgrint", j.f.c.