[sane-devel] unpaper default parameter - empty output bug

Bertrik Sikken bertrik@zonnet.nl
Fri, 11 Mar 2005 23:25:42 +0100


Peter Fales wrote:
> Thanks for all your help.  I think we're getting closer.  I'm using the 
> Makefile rules supplied with unpaper:
> 
> unpaper:
>         cc     unpaper.c   -o unpaper -lm
>         
> so I was already using no optimization.   I was using gcc-3.2.2 which
> is the default compiler on my system.  I tried building with gcc-2.95.3
> and it worked!  It also fails with gcc-3.4.3.  Oh wait!  When I use 
> gcc-2.95.3, it also fails when I use -O2!   Perhaps gcc-3 is doing some
> optimazation automatically that gcc-2 only does when -O is used.  Wierd. 
> 
> Now that I can build both a working and non-working version, I should
> be able to track down where the two are diverging.  Not sure how quickly
> I can get to it though.

Try compiling it with compiler option --pedantic
That results in lots of warnings, of which some look very suspicious.

I' m not sure how big the stack is by default, but unpaper appears
to put quite a lot of local variables on the stack
(at least 140000 ints). Perhaps the stack overflows.

Regards,
Bertrik