Sujet : Re: More Funny Stuff From Joel
De : bowman (at) *nospam* montana.com (rbowman)
Groupes : comp.os.linux.advocacyDate : 11. Jun 2024, 20:23:28
Autres entêtes
Message-ID : <lcrj10Fef9rU1@mid.individual.net>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Pan/0.149 (Bellevue; 4c157ba)
On Tue, 11 Jun 2024 08:13:31 -0400, Chris Ahlstrom wrote:
const is used to enforce certain semantics. Of course, it is not
necessary for a simple C function parameter (e.g. an int) to be const
unless one is pedantic.
I can't cook up a simple example but I've hit instances using functions in
legacy code where one const in a function resulted in having to spread
const around to keep the compiler from whining. It's like the situations
where you use const-cast in C++ to get things to play nice.