News for hackers. Stuff that matters.
Re:Why Const Doesn't Make C Code Faster by egdod on Monday August 19, 2019 @09:29PM (#20743141)
> try __attribute__((const)) which tells it that the func accesses NOTHING but the params, not even global vars

And it doesn’t do anything unintended if you’re lying to it by accessing the global state that you know to be constant?

Re:Why Const Doesn't Make C Code Faster by dmitrygr on Monday August 19, 2019 @09:43PM (#20743197)
It will only assume that it is safe to skip multiple calls to this function with the same parameters, safe to generate extra calls that you did not write, and safe to skip the entire call if the return value is ignored