As of this writing (but perhaps not for very much longer!) the four mainstream compilers on Godbolt Compiler Explorer give four different answers for this simple C++ program:
This article sheds light on how warnings work in GCC, why some warnings are false, and when warnings might not be output. Also discussed are the trade-offs made when implementing checks in GCC.
Online GDB is online compiler and debugger for C/C++. You can compile, run and debug code with gdb online. Using gcc/g++ as compiler and gdb as debugger. Currently C and C++ languages are supported.
If you install macports you can install gcc select, and then choose your gcc version.
/opt/local/bin/port install gcc_select
To see your versions use
port select --list gcc
To select a version use
sudo port select --set gcc gcc40
Execute Awk Script online on Linux - You can compile and run, execute your source code related to Java, C, C++, Pascal, Fortran, PHP, PERL, Ruby and Python programs onnline using your browsers, iPhone, iPad or any other online device like smart TV using this virtual Linux / Unix Server.