Hello,
I am trying to install hotpants in OS environment of Ubuntu 22.04.
I set the cfitsio include and lib path like;
CFITSIOINCDIR = /usr/include/cfitsio/include
LIBDIR = /usr/include/cfitsio/lib
Referring the issue comment in #1,
I used the complier command changing c99 into gnu99;
gcc -funroll-loops -O3 -ansi -std=gnu99 -pedantic-errors -Wall -I/usr/include/cfitsio/include -D_GNU_SOURCE -c main.c
However, the "unused variable" error occurred.
/usr/local/hotpants-master# gcc -funroll-loops -O3 -ansi -std=gnu99 -pedantic-errors -Wall -I/usr/include/cfitsio/include -D_GNU_SOURCE -c main.c
main.c: In function ‘main’:
main.c:21:59: warning: "/*" within comment [-Wcomment]
21 | /*double meanksumSubstamps,scatterksumSubstamps; /* mean and scatter of ksum */
|
main.c:562:38: warning: ‘%d’ directive writing between 1 and 10 bytes into a region of size 4 [-Wformat-overflow=]
562 | sprintf(ttype[k], "Region%d", k);
| ^~
main.c:562:31: note: directive argument in the range [0, 2147483646]
562 | sprintf(ttype[k], "Region%d", k);
| ^~~~~~~~~~
In file included from /usr/include/stdio.h:894,
from main.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtin___sprintf_chk’ output between 8 and 17 bytes into a destination of size 10
38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
main.c:1870:30: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
1870 | sprintf(hInfo, "%s %s", hInfo, argv[i]);
| ^
In file included from /usr/include/stdio.h:894,
from main.c:1:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:38:10: note: ‘__builtin___sprintf_chk’ output 2 or more bytes (assuming 2049) into a destination of size 2048
38 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | __glibc_objsize (__s), __fmt,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 | __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~
I found the unused variable error occurs when the defined variable is not used in the code.
Can somebody help me?
Hello,
I am trying to install hotpants in OS environment of Ubuntu 22.04.
I set the cfitsio include and lib path like;
Referring the issue comment in #1,
I used the complier command changing c99 into gnu99;
gcc -funroll-loops -O3 -ansi -std=gnu99 -pedantic-errors -Wall -I/usr/include/cfitsio/include -D_GNU_SOURCE -c main.cHowever, the "unused variable" error occurred.
I found the unused variable error occurs when the defined variable is not used in the code.
Can somebody help me?