Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 4 years ago

Language

C++

Compiler

gcc 10.1.0

Options
Warnings
Don't Use Boost
C++03
-pedantic

Author

anonymous

over 4 years ago

$ g++ prog.cc -Wall -Wextra -std=c++98 -pedantic
prog.cc:5:6: error: declaration does not declare anything [-fpermissive]
    5 | std::string;
      |      ^~~~~~
prog.cc: In function 'int main()':
prog.cc:10:28: error: 'pow' cannot be used as a function
   10 | cout <<(t1 = 1 / (pow)(b, 3) (lg) (y / x) (pow)(a, 2)(pow)(x, 2) / (pow)(2*y, 2));
      |                            ^
prog.cc:10:80: error: 'pow' cannot be used as a function
   10 | cout <<(t1 = 1 / (pow)(b, 3) (lg) (y / x) (pow)(a, 2)(pow)(x, 2) / (pow)(2*y, 2));
      |                                                                                ^
prog.cc:11:25: error: expression cannot be used as a function
   11 | cout << (t2 = (1 / a)(tg)(a*x / 2) + (1 / a)(log) * tg * (a * x / 2));
      |                         ^
prog.cc:11:49: error: expression cannot be used as a function
   11 | cout << (t2 = (1 / a)(tg)(a*x / 2) + (1 / a)(log) * tg * (a * x / 2));
      |                                                 ^
prog.cc:12:14: warning: ISO C++98 does not support the '%lg' gnu_printf format [-Wformat=]
   12 | printf("t1=%lg\n");
      |              ^
prog.cc:12:14: warning: format '%lg' expects a matching 'double' argument [-Wformat=]
   12 | printf("t1=%lg\n");
      |            ~~^
      |              |
      |              double
prog.cc:13:14: warning: ISO C++98 does not support the '%lg' gnu_printf format [-Wformat=]
   13 | printf("t2=%lg\n");
      |              ^
prog.cc:13:14: warning: format '%lg' expects a matching 'double' argument [-Wformat=]
   13 | printf("t2=%lg\n");
      |            ~~^
      |              |
      |              double
prog.cc:14:14: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   14 | printf("log(%f)=%f\n");
      |             ~^
      |              |
      |              double
prog.cc:14:18: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   14 | printf("log(%f)=%f\n");
      |                 ~^
      |                  |
      |                  double
prog.cc:15:14: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   15 | printf("tan(%f)=%f\n");
      |             ~^
      |              |
      |              double
prog.cc:15:18: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   15 | printf("tan(%f)=%f\n");
      |                 ~^
      |                  |
      |                  double
prog.cc:16:14: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   16 | printf("pow(%f)=%f\n");
      |             ~^
      |              |
      |              double
prog.cc:16:18: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   16 | printf("pow(%f)=%f\n");
      |                 ~^
      |                  |
      |                  double
prog.cc:17:15: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   17 | printf("sqrt(%f)=%f\n");
      |              ~^
      |               |
      |               double
prog.cc:17:19: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   17 | printf("sqrt(%f)=%f\n");
      |                  ~^
      |                   |
      |                   double
prog.cc:18:14: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   18 | printf("exp(%f)=%f\n");
      |             ~^
      |              |
      |              double
prog.cc:18:18: warning: format '%f' expects a matching 'double' argument [-Wformat=]
   18 | printf("exp(%f)=%f\n");
      |                 ~^
      |                  |
      |                  double
prog.cc:8:44: warning: unused variable 'sqrt' [-Wunused-variable]
    8 | double x = 7.7, y = 9.8, a = 3.1, b = 5.2, sqrt, lg, cub, tg, pow ,t1,t2;
      |                                            ^~~~
prog.cc:8:54: warning: unused variable 'cub' [-Wunused-variable]
    8 | double x = 7.7, y = 9.8, a = 3.1, b = 5.2, sqrt, lg, cub, tg, pow ,t1,t2;
      |                                                      ^~~
Exit Code:
1