Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Warning when compiling tests #3

Open
alejandro-colomar opened this issue Mar 14, 2020 · 1 comment
Open

BUG: Warning when compiling tests #3

alejandro-colomar opened this issue Mar 14, 2020 · 1 comment

Comments

@alejandro-colomar
Copy link

alejandro-colomar commented Mar 14, 2020

$ make tests
gcc -O3 -I./src -o test/anim test/anim.c gnuplot_i.o
gcc -O3 -I./src -o test/example test/example.c gnuplot_i.o
gcc -O3 -I./src -lm -o test/png test/png.c gnuplot_i.o
test/png.c: In function ‘main’:
test/png.c:42:53: warning: passing argument 6 of ‘gnuplot_plot_x_multi_y’ from incompatible pointer type [-Wincompatible-pointer-types]
   42 |  gnuplot_plot_x_multi_y(g, x, y, N_POINTS, N_LINES, t);
      |                                                     ^
      |                                                     |
      |                                                     char **
In file included from test/png.c:7:
./src/gnuplot_i.h:408:18: note: expected ‘const char **’ but argument is of type ‘char **’
  408 |     const char** title);
      |     ~~~~~~~~~~~~~^~~~~

This is without changing the Makefile

@alejandro-colomar
Copy link
Author

If I add -Wall -Wextra, you get all this:

$ make tests
gcc -O3 -I./src -Wall -Wextra -c -o gnuplot_i.o src/gnuplot_i.c
gcc -O3 -I./src -Wall -Wextra -o test/anim test/anim.c gnuplot_i.o
test/anim.c: In function ‘main’:
test/anim.c:14:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
   14 | int main(int argc, char *argv[])
      |          ~~~~^~~~
test/anim.c:14:26: warning: unused parameter ‘argv’ [-Wunused-parameter]
   14 | int main(int argc, char *argv[])
      |                    ~~~~~~^~~~~~
gcc -O3 -I./src -Wall -Wextra -o test/example test/example.c gnuplot_i.o
test/example.c: In function ‘main’:
test/example.c:15:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
   15 | int main(int argc, char *argv[])
      |          ~~~~^~~~
test/example.c:15:26: warning: unused parameter ‘argv’ [-Wunused-parameter]
   15 | int main(int argc, char *argv[])
      |                    ~~~~~~^~~~~~
gcc -O3 -I./src -Wall -Wextra -lm -o test/png test/png.c gnuplot_i.o
test/png.c: In function ‘main’:
test/png.c:42:53: warning: passing argument 6 of ‘gnuplot_plot_x_multi_y’ from incompatible pointer type [-Wincompatible-pointer-types]
   42 |  gnuplot_plot_x_multi_y(g, x, y, N_POINTS, N_LINES, t);
      |                                                     ^
      |                                                     |
      |                                                     char **
In file included from test/png.c:7:
./src/gnuplot_i.h:408:18: note: expected ‘const char **’ but argument is of type ‘char **’
  408 |     const char** title);
      |     ~~~~~~~~~~~~~^~~~~
test/png.c:12:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
   12 | int main(int argc, char * argv[])
      |          ~~~~^~~~
test/png.c:12:27: warning: unused parameter ‘argv’ [-Wunused-parameter]
   12 | int main(int argc, char * argv[])
      |                    ~~~~~~~^~~~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant