[sane-devel] error when making sane backends - possibly due to changes in cc ?

Bob Gustafson bobgus at rcn.com
Sun Oct 27 17:58:18 UTC 2013


On 10/27/2013 11:34 AM, Paul Newall wrote:
> I upgraded to ubuntu 13.10
> Now I get errors when making sane-backends that I don't think I got 
> before. The error messages are:
>
> scanimage.c: In function ‘main’:
> scanimage.c:1897:5: error: format not a string literal and no format 
> arguments [-Werror=format-security]
> printf (start);
> ^
> scanimage.c:1911:9: error: format not a string literal and no format 
> arguments [-Werror=format-security]
> printf (start);
> ^
>
> I'm guessing ubuntu 13.10 has a new version of gcc which now 
> classifies these as errors instead of warnings?
> gcc --version returns this:
> gcc (Ubuntu/Linaro 4.8.1-10ubuntu8) 4.8.1
>
> and I think ubuntu 13.04 had gcc version 4.7.3
>
> adding a dummy format argument to lines 1897 and 1911 of scanimage.c 
> like this:
> printf (start,0);
> allows it to compile without errors, but I don't know if that might 
> cause any problems at run time?
> Perhaps there is a better solution, like an option telling gcc to 
> treat these as warnings not errors?
>
> regards,
> Paul Newall
>

I was able to make sane-backends-1.0.24 without any errors (but I do get 
a lot of warnings - mostly warning: variable 'i' set but not used)

I also have the same version of gcc:
gcc (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)

It looks like I have the same source:

[user1 at hoho6 sane-backends-1.0.24]$ grep -rn "printf (start);" *
frontend/scanimage.c:1897:                printf (start);
frontend/scanimage.c:1911:              printf (start);
[user1 at hoho6 sane-backends-1.0.24]$

System version (at the moment, may have been slightly older at compile 
time):

[user1 at hoho6 sane-backends-1.0.24]$ uname -a
Linux hoho6.chidig.com 3.11.6-200.fc19.x86_64 #1 SMP Fri Oct 18 22:34:18 
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[user1 at hoho6 sane-backends-1.0.24]$

I did use options for configure that came from the Fedora packaging of 
sane-backends-1.0.23

[user1 at hoho6 sane-backends-1.0.24]$ cat configRDG2.sh
./configure --host=x86_64-redhat-linux-gnu 
--build=x86_64-redhat-linux-gnu --program-prefix= 
--disable-dependency-tracking --prefix=/usr --exec-prefix=/usr 
--bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc 
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 
--libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib 
--mandir=/usr/share/man --infodir=/usr/share/info --with-gphoto2=/usr 
--with-docdir=/usr/share/doc/sane-backends-1.0.23 --disable-locking 
--disable-rpath --enable-libusb_1_0 --enable-pthread 2>&1 | tee config.out

Most of these are related to slightly different locations of things in 
Fedora compared to Ubuntu. As I recall, I was able to compile with no 
errors even using the plain vanilla ./configure

-------

Looking at my 'make.out' file ( from make 2>&1 | tee make.out ), a 
typical gcc command is of the form:

gcc -g -O2 -W -Wall -I/usr......

No obvious differences from your try.

Bob G



More information about the sane-devel mailing list