[sane-devel] hs2p backend
m. allan noah
kitno455 at gmail.com
Wed Nov 21 12:38:11 UTC 2007
On 11/21/07, jazz_johnson at verizon.net <jazz_johnson at verizon.net> wrote:
> On Tuesday 20 November 2007, m. allan noah wrote:
> > my flags from backend/Makefile (generated by stock configure)
> >
> > CFLAGS = -g -O2 -W -Wall -Wcast-align -Wcast-qual
> > -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith
> > -Wreturn-type -Wstrict-prototypes -pedantic -ansi
> >
> > not sure why yours are not the same?
>
> I finally figured out that I needed to specifiy --enable-warnings for configure:
> if test "${ac_cv_c_compiler_gnu}" = "yes"; then
> NORMAL_CFLAGS="\
> -W \
> -Wall"
> WARN_CFLAGS="\
> -W \
> -Wall \
> -Wcast-align \
> -Wcast-qual \
> -Wmissing-declarations \
> -Wmissing-prototypes \
> -Wpointer-arith \
> -Wreturn-type \
> -Wstrict-prototypes \
> -pedantic"
>
> So I re-configured:
> sane-backends# autoheader;autoconf;./configure --enable-warnings
> and finally got gcc to run with warnings!
>
ahh, you are rebuilding configure. i'm lazy, i've just been manually
adding your backend name to it.
> I've placed latest hs2p_patch.gz on my hs2p_sane_backend website.
> It compiles on both x86 and x86_64 with the aforementioned warnings
> related to free(sane.name) and free(sane.model) in sane_exit():
>
> # zgrep warn x86_*.gz
> x86_64_log.gz:hs2p.c:1394: warning: cast discards qualifiers from pointer target type
> x86_64_log.gz:hs2p.c:1395: warning: cast discards qualifiers from pointer target type
> x86_log.gz:hs2p.c:1394: warning: cast discards qualifiers from pointer target type
> x86_log.gz:hs2p.c:1395: warning: cast discards qualifiers from pointer target type
>
ok, i've not tried it yet, but i think you've reached the limits of my
ability. i think that since sane.name is const, either free or the
cast is going to complain. maybe someone else has an idea.
allan
--
"The truth is an offense, but not a sin"
More information about the sane-devel
mailing list