Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Language

C++

Compiler

gcc HEAD 11.0.0 20200919 (experimental)

Options
Warnings
Boost 1.73.0
C++2a(GNU)
-pedantic

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2a -pedantic
prog.cc: In function 'void function_C4838(double)':
prog.cc:11:21: warning: narrowing conversion of 'd1' from 'double' to 'int' [-Wnarrowing]
   11 |     int ai[] = { 1, d1 };    // warning C4838
      |                     ^~
prog.cc:13:14: warning: narrowing conversion of 'd1' from 'double' to 'int' [-Wnarrowing]
   13 |     S1 s12 { d1, 2, 3 };     // warning C4838
      |              ^~
prog.cc:10:12: warning: unused variable 'ad' [-Wunused-variable]
   10 |     double ad[] = { 1, d1 }; // OK
      |            ^~
prog.cc:11:9: warning: unused variable 'ai' [-Wunused-variable]
   11 |     int ai[] = { 1, d1 };    // warning C4838
      |         ^~
prog.cc:12:8: warning: unused variable 's11' [-Wunused-variable]
   12 |     S1 s11 = { 1, 2, d1 };   // OK
      |        ^~~
prog.cc:13:8: warning: unused variable 's12' [-Wunused-variable]
   13 |     S1 s12 { d1, 2, 3 };     // warning C4838
      |        ^~~
prog.cc:14:8: warning: unused variable 's13' [-Wunused-variable]
   14 |     S1 s13 { static_cast<int>(d1), 2, 3 }; // possible fix for C4838
      |        ^~~
Exit Code:
0