Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 3 years ago

Language

C++

Compiler

gcc 12.1.0

Options
Warnings
Optimization
Don't Use Boost
C++11
-pedantic

Author

anonymous

almost 3 years ago

$ g++ prog.cc -Wall -Wextra -O2 -march=native -std=c++11 -pedantic
prog.cc: In function 'int main()':
prog.cc:11:12: warning: ISO C++ forbids variable length array 'pizzas' [-Wvla]
   11 |     string pizzas[row][column] {{"pizza0","pizza1","pizza2","pizza3","pizza4"},
      |            ^~~~~~
prog.cc:11:12: warning: ISO C++ forbids variable length array 'pizzas' [-Wvla]
prog.cc:18:13: error: cannot convert 'std::string (*)[column]' {aka 'std::__cxx11::basic_string<char> (*)[column]'} to 'std::string*' {aka 'std::__cxx11::basic_string<char>*'}
   18 |     example(pizzas, i_row, i_column);
      |             ^~~~~~
      |             |
      |             std::string (*)[column] {aka std::__cxx11::basic_string<char> (*)[column]}
prog.cc:7:22: note:   initializing argument 1 of 'void example(std::string*, int, int)'
    7 | void example(string *pizzas, int i_row, int i_column);
      |              ~~~~~~~~^~~~~~
prog.cc: In function 'void example(std::string*, int, int)':
prog.cc:30:26: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   30 |     for (size_t i = 0; i != i_row; i++){
      |                        ~~^~~~~~~~
prog.cc:32:30: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   32 |         for (size_t j = 0; j != i_column; j++)
      |                            ~~^~~~~~~~~~~
Exit Code:
1