Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 4 years ago

Language

C++

Compiler

gcc 11.1.0

Options
Warnings
Don't Use Boost
C++2b
-pedantic
Raw compiler options
-Wvla

Author

anonymous

almost 4 years ago

$ g++ prog.cc -Wall -Wextra -std=c++2b -pedantic -Wvla
prog.cc: In function 'int main()':
prog.cc:98:17: warning: unused variable 'position' [-Wunused-variable]
   98 |     int tempnum,position;
      |                 ^~~~~~~~
prog.cc:124:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
  124 |         cout<<"Element at top is"<<s1.peek()<<endl;
      |                                               ^~~~
prog.cc:125:5: note: here
  125 |     case 4:
      |     ^~~~
prog.cc:126:19: warning: this statement may fall through [-Wimplicit-fallthrough=]
  126 |         s1.display();
      |         ~~~~~~~~~~^~
prog.cc:127:5: note: here
  127 |     case 5:
      |     ^~~~
prog.cc:128:50: warning: this statement may fall through [-Wimplicit-fallthrough=]
  128 |         cout<<"Number of elements is:"<<s1.count();
      |                                                  ^
prog.cc:129:5: note: here
  129 |     case 6:
      |     ^~~~
prog.cc:135:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
  135 |         if(s1.isFull()==true){
      |         ^~
prog.cc:138:5: note: here
  138 |     default:
      |     ^~~~~~~
prog.cc: In member function 'int Stack::peek()':
prog.cc:75:5: warning: control reaches end of non-void function [-Wreturn-type]
   75 |     }
      |     ^

MAIN MENU
1) Push
2) Pop
3) Peek
4) Display
5) Count
6) Check Empty
7) Check Full
8) Exit
Enter your choice:Enter Valid Option
MAIN MENU
1) Push
2) Pop
3) Peek
4) Display
5) Count
6) Check Empty
7) Check Full
8) Exit
Enter your choice:Enter Valid Option
Exit Code:
0