3 ms·
> 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
by egdod 7y ago
> 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?
- dmitrygr 7y agoIt 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