gcc flags for specific msvc compiler warnings

Jul 25, 2019 at 2:46pm
I'm looking for the gcc equivalent to 4 different compiler warnings that i am experiencing when using msvc. I do not wish to suppress them as they should be resolved because those only using linux don't see them and keep committing changes that introduce these warnings.

https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4626?view=vs-2019
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4627?view=vs-2019

The next two are found at https://docs.microsoft.com/en-us/cpp/preprocessor/compiler-warnings-that-are-off-by-default?view=vs-2019

C5026 (level 1 and level 4) 'type': move constructor was implicitly defined as deleted
C5027 (level 1 and level 4) 'type': move assignment operator was implicitly defined as deleted

Does any one know if these warnings can be turned on using gcc?

Thank you,

Tom



Last edited on Jul 25, 2019 at 2:47pm
Jul 25, 2019 at 3:22pm
Are you saying that -Wall -Wextra -pedantic does not turn on these warnings?
Jul 25, 2019 at 4:04pm
AFAIK, there is no way to turn on these warnings with g++.
Jul 25, 2019 at 7:07pm
is it just telling you that it optimized away unused automatically created items?
Jul 26, 2019 at 5:38am
No. It is telling us that it conformed to the standard; and as per the standard, the class is not copyable / moveable.

Quite understandably, g++ does not generate a warning for this; it would generate an error if we try to use the implicitly deleted function, and also give us the reason for it to be implicitly deleted.
Snippet: http://coliru.stacked-crooked.com/a/c4b19446d7017c3f
Last edited on Jul 26, 2019 at 6:11am
Jul 29, 2019 at 9:42am
Thank you everyone for the replies.
Topic archived. No new replies allowed.