|
|
Subscribe / Log in / New account

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.


to post comments

Defining constants rather than using preprocessor

Posted Jul 22, 2021 6:26 UTC (Thu) by pbonzini (subscriber, #60935) [Link]

It is undefined behavior if a const is changed.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds