It has a semantic effect. For simplicity, the function marked inline can be defined several times in one program - although all definitions must be equivalent to each other. therefore, for correctness, the presence of inline is required when the function definition is included in the headers (which, in turn, makes the definition visible so that the compiler can embed it without LTO).
In addition, for inline optimization, "never" is an absolutely safe approximation. This probably has some effect on some compilers, but nothing is worth losing sleep, especially not without real hard data. For example, in the following code using Clang 3.0 or GCC 4.7 , main contains the same code whether work inline checked or not. The only difference is whether work remains an autonomous function for other translation units to reference or be deleted.
void work(double *a, double *b) { if (*b > *a) *a = *b; } void maxArray(double* x, double* y) { for (int i = 0; i < 65536; i++) {
delnan
source share