Hello,
I have a make file that looks like this:
SHELL = /bin/sh
.SUFFIXES: .c .o
#note for Windows: replace khmm.so with khmm.dll below
#note for Mac OS X: replace -shared with -dynamiclib, replace khmm.so with khmm$
#note for Solaris: replace gcc with cc below
CC = gcc
LD = gcc
CFLAGS = `perl -MExtUtils::Embed -e ccopts` -fPIC
LDFLAGS = `perl -MExtUtils::Embed -e ldopts`
ARCH = `perl -MConfig -e 'print $$Config{archname}'`
VER = `perl -MConfig -e 'print $$Config{version}'`
khmm.dylib: khmm_wrap.o khmm.o kc.o khmmDev.o
$(LD) -dynamiclib -o $@ $^ $(LDFLAGS)
mkdir -p $(VER)
mkdir -p $(VER)/$(ARCH)/
mkdir -p $(VER)/$(ARCH)/auto/
when I type "make" in the directory where the make file is located I get this:
gcc `perl -MExtUtils::Embed -e ccopts` -fPIC -c -o khmm_wrap.o khmm_wrap.c
gcc `perl -MExtUtils::Embed -e ccopts` -fPIC -c -o khmm.o khmm.c
khmm.c:1091:83: warning: data argument not used by format string
[-Wformat-extra-args]
...fprintf(stderr, "state i=%i is better than prob=$f\n", i, *pprob);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
gcc `perl -MExtUtils::Embed -e ccopts` -fPIC -c -o kc.o kc.c
kc.c:192:9: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
croak (error_text);
^~~~~~~~~~
kc.c:200:8: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
warn (error_text);
^~~~~~~~~~
2 warnings generated.
kc.c:200:8: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
warn (error_text);
^~~~~~~~~~
1 warning generated.
gcc `perl -MExtUtils::Embed -e ccopts` -fPIC -c -o khmmDev.o khmmDev.c
gcc -dynamiclib -o khmm.dylib khmm_wrap.o khmm.o kc.o khmmDev.o `perl -MExtUtils::Embed -e ldopts`
mkdir -p `perl -MConfig -e 'print $Config{version}'`
mkdir -p `perl -MConfig -e 'print $Config{version}'`/`perl -MConfig -e 'print $Config{archname}'`/
mkdir -p `perl -MConfig -e 'print $Config{version}'`/`perl -MConfig -e 'print $Config{archname}'`/auto/
mv khmm.dylib `perl -MConfig -e 'print $Config{version}'`/`perl -MConfig -e 'print $Config{archname}'`/
Why do I get the warnings?
Lavinia
I have a make file that looks like this:
SHELL = /bin/sh
.SUFFIXES: .c .o
#note for Windows: replace khmm.so with khmm.dll below
#note for Mac OS X: replace -shared with -dynamiclib, replace khmm.so with khmm$
#note for Solaris: replace gcc with cc below
CC = gcc
LD = gcc
CFLAGS = `perl -MExtUtils::Embed -e ccopts` -fPIC
LDFLAGS = `perl -MExtUtils::Embed -e ldopts`
ARCH = `perl -MConfig -e 'print $$Config{archname}'`
VER = `perl -MConfig -e 'print $$Config{version}'`
khmm.dylib: khmm_wrap.o khmm.o kc.o khmmDev.o
$(LD) -dynamiclib -o $@ $^ $(LDFLAGS)
mkdir -p $(VER)
mkdir -p $(VER)/$(ARCH)/
mkdir -p $(VER)/$(ARCH)/auto/
when I type "make" in the directory where the make file is located I get this:
gcc `perl -MExtUtils::Embed -e ccopts` -fPIC -c -o khmm_wrap.o khmm_wrap.c
gcc `perl -MExtUtils::Embed -e ccopts` -fPIC -c -o khmm.o khmm.c
khmm.c:1091:83: warning: data argument not used by format string
[-Wformat-extra-args]
...fprintf(stderr, "state i=%i is better than prob=$f\n", i, *pprob);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
gcc `perl -MExtUtils::Embed -e ccopts` -fPIC -c -o kc.o kc.c
kc.c:192:9: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
croak (error_text);
^~~~~~~~~~
kc.c:200:8: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
warn (error_text);
^~~~~~~~~~
2 warnings generated.
kc.c:200:8: warning: format string is not a string literal
(potentially insecure) [-Wformat-security]
warn (error_text);
^~~~~~~~~~
1 warning generated.
gcc `perl -MExtUtils::Embed -e ccopts` -fPIC -c -o khmmDev.o khmmDev.c
gcc -dynamiclib -o khmm.dylib khmm_wrap.o khmm.o kc.o khmmDev.o `perl -MExtUtils::Embed -e ldopts`
mkdir -p `perl -MConfig -e 'print $Config{version}'`
mkdir -p `perl -MConfig -e 'print $Config{version}'`/`perl -MConfig -e 'print $Config{archname}'`/
mkdir -p `perl -MConfig -e 'print $Config{version}'`/`perl -MConfig -e 'print $Config{archname}'`/auto/
mv khmm.dylib `perl -MConfig -e 'print $Config{version}'`/`perl -MConfig -e 'print $Config{archname}'`/
Why do I get the warnings?
Lavinia