This is what I knew about it: > `attribute((const))` function attribute > Many functions examine only the arguments passed to them, and have no effects except for the return value. This is a much stricter class than `attribute((pure))`, because a function is not permitted to read global memory. If a function is known to operate only on its arguments then it can be subject to common sub-expression elimination and loop optimizations. >https://stackoverflow.com/questions/29117836/attribute-const-vs-attribute-pure -in-gnu-c