Closed brancomat closed 8 years ago
(che in realtà è un warning, ma visto che il default di F24 è -Werror=format-security sarebbe da risolvere)
-Werror=format-security
libtool: compile: gfortran -DHAVE_CONFIG_H -I. -I.. -I../base -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -I/usr/lib64/gfortran/modules -fbackslash -c log4fortran.F90 -o log4fortran.o >/dev/null 2>&1 /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -c -o log4fortran_c.lo log4fortran_c.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -c log4fortran_c.c -fPIC -DPIC -o .libs/log4fortran_c.o log4fortran_c.c: In function 'l4f_category_log_': log4fortran_c.c:57:57: error: format not a string literal and no format arguments [-Werror=format-security] log4c_category_log(cnfCptr(*a_category), *a_priority, ptr_a_format); ^~~~~~~~~~~~ log4fortran_c.c: In function 'l4f_log_': log4fortran_c.c:76:48: error: format not a string literal and no format arguments [-Werror=format-security] log4c_category_log(default_cat, *a_priority, ptr_a_format); ^~~~~~~~~~~~ cc1: some warnings being treated as errors Makefile:486: recipe for target 'log4fortran_c.lo' failed make[2]: *** [log4fortran_c.lo] Error 1
Ho escogitato una soluzione, mettendo un formato fisso "%s" e passando la stringa fortran come variabile e non come formato.
(che in realtà è un warning, ma visto che il default di F24 è
-Werror=format-security
sarebbe da risolvere)