• Gaetan (unregistered)

    Yikes (and Frist?) ! I had almost forgotten about that one, and Remy’s article just appears when I have to dig into that part again … Well I can remember it made me pretty worked up at the time. At least I know what I am getting into now.

  • (nodebb)

    Which, if s.sorties is uninitialized and numero is zero, that check will work

    Either it's meaningless because s.sorties is an actual array, and therefore not a NULL pointer (and therefore it is always true), or because s.sorties is an actual pointer, in which case the condition is false if numero is zero and the pointer is NULL (NULL+0 == NULL which casts to bool as false ), and true in all other cases, including cases which are UB (NULL+non_zero).

    However, if s.sorties is uninitialised, we're immediately into first-stripe UB territory for reading from an uninitialised variable.

Leave a comment on “C+=0.25”

Log In or post as a guest

Replying to comment #691363:

« Return to Article