Differences in warnings between compilers

closed account (E0p9LyTq)
I regularly use Visual Studio 2017 and Code::Blocks 17.12 (TDM-GCC) 5.1.0 to compile C++ code.

1
2
3
4
5
6
7
8
9
#include <iostream>

int main()
{
   for (int i : { 0, 1 })
   {
      std::cout << (void*) ("abc") << '\n';
   }
}


Compile this in both, default warning levels, TDM-GCC warns of an unused variable (i), VS does not.

Just an interesting (to me) observation, nothing more.
Last edited on
Topic archived. No new replies allowed.