fongoses / leptonica

Automatically exported from code.google.com/p/leptonica
0 stars 0 forks source link

leptonica-1.69: compilation warning #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -fmessage-length=0 -O2 -Wall 
-D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables 
-fasynchronous-unwind-tables -g -c graphics.c  -fPIC -DPIC -o .libs/graphics.o
graphics.c: In function 'fpixAutoRenderContours':
graphics.c:1731:12: warning: variable 'pixd' set but not used 
[-Wunused-but-set-variable]
graphics.c:1746:1: warning: control reaches end of non-void function 
[-Wreturn-type]

This causes an error building packages for openSUSE:

... testing for serious compiler warnings
(using /usr/lib/build/checks-data/check_gcc_output)
(using //.build.log)

I: Program returns random data in a function
E: liblept3 no-return-in-nonvoid-function graphics.c:1746

https://build.opensuse.org/package/show?package=liblept&project=home%3ALazy_Kent
Log attached.

Could you please help with a patch?

Original issue reported on code.google.com by lazy.ken...@gmail.com on 23 Aug 2012 at 9:14

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for reporting this embarrassing error!
gcc (g++) doesn't give an error, and the pix is returned even though there is 
no return statement, so it got the correct result in testing.

It will be fixed in 1.70.  In graphics.c, fpixAutoRenderContours():

(1) remove the declaration of pixd
(2) replace the last line with:
    return fpixRenderContours(fpix, incr, 0.1 * incr);

Original comment by dan.bloo...@gmail.com on 23 Aug 2012 at 10:04

GoogleCodeExporter commented 9 years ago
fixed in 1.70, which you can get at leptonica.org/download.html

Original comment by dan.bloo...@gmail.com on 23 Jan 2014 at 8:42