Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Are there any good mappings between GCC and MSVC warnings? E.g. -Wredundant-move on MSVC

This question is somewhat two fold, one being more general than the other. The specific question is; does MSVC have equivalent warnings to -Wredundant-move? More generally, is there anywhere online, even if it’s someone’s blog, that has a reasonable mapping between GCC and MSVC warnings?

I’m aware that warnings don’t have any requirement to be similar accross platforms, or even exist at all – that’s why I’m interested to find out if there is any reasonable correlation?

For a small bit of background, I’m looking to enable specific -Werrors on a cross-platform project, and would prefer if each platform looked after roughly the same warnings instead of relying on the user to check on both platforms manually.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The specific question is; does MSVC have equivalent warnings to -Wredundant-move?

From what I’ve found, no, MSVC doesn’t.

This implicitly answers the more general question if there’s a good mapping between gcc and MSVC warnings.

But – the future looks promising for the particular kind of warning you asked about:
Under Review – Pessimizing Move Compiler Warning:

"LLVM supports a pessimizing-move compiler warning. In C++17 and newer, this fires when invoking std::move() on a temporary, this results in copy elision not occurring on the temporary. This seems a high value warning that is supported in Clang++ and GCC, but not MSVC."

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading