Defining constants rather than using preprocessor
Defining constants rather than using preprocessor
Posted Jul 21, 2021 2:39 UTC (Wed) by creemj (subscriber, #56061)In reply to: Defining constants rather than using preprocessor by HelloWorld
Parent article: A GPIO driver in Rust
Futhermore const in C does not mean constant, that is, it is a guarantee that the variable will only be read, not written (except at declaration), in the compilation unit, but that is not a guarantee that it will not be written in any circumstance whatsoever.
Posted Jul 22, 2021 6:26 UTC (Thu)
by pbonzini (subscriber, #60935)
[Link]
Defining constants rather than using preprocessor
It is undefined behavior if a const is changed.
