Language
C++
Compiler
gcc 8.2.0
Options
Boost 1.69.0
C++17
no pedantic
$ g++ prog.cc -I/opt/wandbox/boost-1.69.0/gcc-8.2.0/include -std=c++17
Exit Code:
1
Author
anonymous
over 6 years ago
C++
gcc 8.2.0
Author
anonymous
over 6 years ago
$ g++ prog.cc -I/opt/wandbox/boost-1.69.0/gcc-8.2.0/include -std=c++17
prog.cc: In function 'int main()':
prog.cc:2:14: warning: overflow in conversion from 'int' to 'char' changes value from '13045' to ''\37777777765'' [-Woverflow]
char a = 13045;
^~~~~
prog.cc:3:18: error: narrowing conversion of '13045' from 'int' to 'char' inside { } [-Wnarrowing]
char a2{13045};
^
prog.cc:4:18: warning: overflow in conversion from 'int' to 'char' changes value from '13045' to ''\37777777765'' [-Woverflow]
char a3(13045);
^