Reputation: 4002
I am writing a Cpp library in VS2022 community, and for some reason VS gives me a "VCR003 Function can be made static" warning for the exported functions. I am not an export, but it makes absolutely no sense that exported functions will be made with static linkage. What is the right approach here, should I simply suppress these warnings?
Example:
extern "C" {
__declspec(dllexport)
void foo()
{
// Foo code
}
}
Edit: It turns out this is a bug in VS. For those who encounter the same issue, I am using:
Upvotes: 1
Views: 561
Reputation: 4259
As the link provided by user17732522:
https://developercommunity.visualstudio.com/t/Information-message-VCR003-given-for-ext/10729403
A fix for this issue has been internally implemented and is being prepared for release.
For me: the message occurs when put the code in cpp file:
Upvotes: 0