Re:Const and Optimization in C
by cygx on Monday July 25, 2016 @07:32AM
(#12157905)
The author does not think that, all he does is point out correctly that const-qualifying a pointer's target type cannot be used for optimization purposes as it does not make any actual guarantees about object mutability.
Note that in contrast, restrict-qualifying a ponter-to-const (ie `const int *restrict x`) does make such guarantees, but only callee-side.
Note that in contrast, restrict-qualifying a ponter-to-const (ie `const int *restrict x`) does make such guarantees, but only callee-side.