3 ms·
Among the gcc extensions to C and C++ there are 2 attributes for functions without side effects: __attribute__ ((pure)) __attribute__ ((const)) The 'p
by adrian_b 4y ago
Among the gcc extensions to C and C++ there are 2 attributes for functions without side effects:
__attribute__ ((pure))
__attribute__ ((const))
The 'pure' attribute imposes similar but looser restrictions on a function's definition than the 'const' attribute: 'pure' allows the function to read any non-volatile memory, even if it changes in between successive invocations of the function.