Re:The C Bounded Model Checker: Criminally Underused
by o11c on Tuesday January 30, 2024 @07:40PM
(#39198154)
For reference, GCC has `__builtin_clear_padding` which is very useful to avoid problems there.
Re:The C Bounded Model Checker: Criminally Underused
by saagarjha on Tuesday January 30, 2024 @10:49PM
(#39199631)
> After initializing all members of a struct, the padding bytes of that struct are still uninitialized.
Depends on how you initialize them. If you do it all in one go, then yes. If you partially initialize it, then no: some of the padding bytes are guaranteed to be zero. (Observing this and maintaining this variant is an exercise for the reader.)
The C standard text is barely sufficient for the purposes of compilers, but wholly insufficient for what a model checker would need to know.