I’ve set up a compiler /Za option to disable lanquage extensions so that compiler uses strictly standard ISO C++.
Here is sample interface class for which I’m receiving following warning
warning C4180: qualifier applied to function type has no meaning;
ignored
It is about const qualifier in return type of function, if I remove const, warning disapears but I don’t wanna do that, neather I want to enable lanqage extenstions back.
My question is is: Is that warning reasonable?
If it is not then I’ll use pragma to disable the warning but before that I would like to be sure that this warning is “false positive”
Because The following class is Correct ANSI ISO C++ Isn’it? so the warning should be disabled?
class IBet
{
public:
IBet() { };
virtual ~IBet() = 0 { };
virtual const float parentChips() const = 0; // Warning C4180
virtual const short parentChilds() const = 0; // Warning C4180
// ...
};
The return value of the two functions is declared as
const. Since it is passed by value it has no meaning. You can remove thatconstsince it serves absolutely no purpose.