[GRASS5] bug in lib/image/open.c?

Hi all,

since the proper return types have been added to lib/image/open.c (last
saturday, I believe), compilation fails with the following error:

gcc -I/usr/local/src/grass-cvs/include
-I/usr/local/src/grass-cvs/dist.x86_64-unknown-linux-gnu/include/grass
-g -D_FILE_OFFSET_BITS=64 -O2 -march=k8 -fomit-frame-pointer -pipe
-Wall -Wconversion -Wno-implicit-int -fPIC -DPACKAGE=
\""grasslibs"\" -DPACKAGE=\""grasslibs"\"
-I/usr/local/src/grass-cvs/include
-I/usr/local/src/grass-cvs/dist.x86_64-unknown-linux-gnu/include/grass \
        -o OBJ.x86_64-unknown-linux-gnu/open.o -c open.c
open.c: In function `imgopen':
open.c:60: warning: implicit declaration of function `i_errhdlr'
open.c:134: warning: passing arg 1 of `cvtimage' from incompatible
pointer type
open.c:172: warning: passing arg 2 of `cvtlongs' as signed due to
prototype
open.c:178: warning: passing arg 2 of `cvtlongs' as signed due to
prototype
open.c: In function `cvtimage':
open.c:238: warning: passing arg 1 of `cvtshorts' from incompatible
pointer type
open.c:238: warning: passing arg 2 of `cvtshorts' with different width
due to prototype
open.c:239: warning: passing arg 2 of `cvtlongs' with different width
due to prototype
open.c:240: warning: passing arg 2 of `cvtlongs' with different width
due to prototype
open.c: At top level:
open.c:253: error: conflicting types for 'i_errhdlr'
open.c:60: error: previous implicit declaration of 'i_errhdlr' was here
open.c:276: warning: 'getshort' defined but not used
open.c:284: warning: 'getlong' defined but not used
make: *** [OBJ.x86_64-unknown-linux-gnu/open.o] Error 1

When I remove the 'void' from line 253, everything compiles fine.

I'm on gentoo linux, amd64, gcc 3.4.3, grass fresh from cvs.

Regards,
Vincent.

On Tue, 2005-06-14 at 17:32 +0200, Vincent Schut wrote:

Hi all,

since the proper return types have been added to lib/image/open.c (last
saturday, I believe), compilation fails with the following error:

I was waiting to hear back from the list before I fixed that function.
I was unaware that it was causing compilation errors (it hadn't for me).

The question was: Should I replace i_err*() functions with G_message()
and G_set_error_routine() or simply duplicate their functionality?

--
Brad Douglas <rez@touchofmadness.com>

On Tue, 2005-06-14 at 17:32 +0200, Vincent Schut wrote:

Hi all,

since the proper return types have been added to lib/image/open.c (last
saturday, I believe), compilation fails with the following error:

Ugh. Hit send too early.

I can either replace the i_err*() functions with equivalent G_message()
commands or duplicate the G_message() functions.

Do we want to convolute already independent libraries with G_*()
commands or should they remain independent? The library could benefit
from other G_*() functions as well, but is not absolutely necessary.

I just committed my current changes which simply copies the code of
G_message() to i_errhdlr().

My apologies for the inconvenience.

--
Brad Douglas <rez@touchofmadness.com>