Skip to content

Const return values

Mikel Irazabal requested to merge const_return_values into develop

Const return values in C have no meaning. Basically, the const qualifier is applied to the r-value that returns, and thus, it has no effect. e.g.,

const int foo();

int a = foo(); // This is valid C code, const is not applied to the a variable

It also generates other warnings

Merge request reports