Ben Pfaff

Results 96 comments of Ben Pfaff

`!` as a primary expression could mean "invalid".

C specifies that `a += b` is equivalent to `a = a + b` except that `a` is evaluated only once. C99 says, for example: > A compound assignment of...

In addition to division by zero, in 2's complement arithmetic, dividing the smallest value by -1 yields an unrepresentable value.

C mandates that integer division rounds toward zero, so I'd be surprised to see other behavior if this gets standardized at all.

What's an example of a padding field with these semantics in real life? I usually think of "padding" as being forced to a particular fixed value (normally all-zeros). If there's...

Thanks @vgurevich. OK. It's hard for me to see uninitialized data without immediately thinking INFORMATION DISCLOSURE VULNERABILITY but I guess if it never crosses security domains (one machine to another,...

Thanks, you confirmed what I guessed. Extra thanks for the forum URL! Still would appreciate something in the spec, perhaps just a sentence saying that device_ids are managed out-of-band. Bonus...

Thanks for the explanation!

Some bikeshedding thoughts: - Being able to "clear" a union to "no longer initialized" or, alternatively, avoiding the "not initialized" case somehow. - It seems that I would forget sometimes...

> * Sometimes in `switch (s)`, the `s` will be a long expression. It's not great to have to repeat that in each case. It would be nice if the...