News for hackers. Stuff that matters.
Re:Const and Optimization in C by arm85 on Monday July 25, 2016 @07:21AM (#12157862)
"void foo(const int * );"

"The function foo takes a const pointer".

I thought foo was taking a pointer a constant, where the pointer itself could change. This may seem pedantic, but perhaps the optimization he expected would have worked if foo took "const int * const ".

Re:Const and Optimization in C by cygx on Monday July 25, 2016 @07:26AM (#12157877)
`const int * ` and `int const * ` are semantically identical, ie `const int const * ` is a duplicate declaration.
Re:Const and Optimization in C by arm85 on Monday July 25, 2016 @07:29AM (#12157890)
Opps, I'll update my post. Looks like peeyek had already pointed out that the pointer isn't const anyway.