Thiago Canozzo Lahr wrote:
Hi,

I'm compiling nessus on a AIX 4.3.3 box, but the following error is apearing:

cd nasl && make
make[1]: Entering directory `/home/tclahr/libnasl/nasl'
/bin/sh /home/tclahr/libnasl/libtool --silent gcc -pipe -g -O2 `sh ./cflags` -c nasl_packet_forgery.c
/bin/sh /home/tclahr/libnasl/libtool --silent gcc -pipe -g -O2 `sh ./cflags` -c nasl_socket.c
nasl_socket.c: In function `nasl_recv':
nasl_socket.c:354: warning: passing arg 5 of `getsockopt' from incompatible pointer type
nasl_socket.c: In function `nasl_send':
nasl_socket.c:498: warning: passing arg 5 of `getsockopt' from incompatible pointer type
nasl_socket.c: In function `nasl_close_socket':
nasl_socket.c:529: warning: passing arg 5 of `getsockopt' from incompatible pointer type

These three seem to be an issue with how getsockopt is defined in AIX [1] nasl uses an int pointer and AIX's libc expects a size_t. You could maybe try casting it, i.e. change:
e = getsockopt(soc, SOL_SOCKET, SO_TYPE, &type, &opt_len);
to
e = getsockopt(soc, SOL_SOCKET, SO_TYPE, &type, (size_t) &opt_len);


to see if it works.


/bin/sh /home/tclahr/libnasl/libtool --silent gcc -pipe -g -O2 `sh ./cflags` -c nasl_crypto.c
/bin/sh /home/tclahr/libnasl/libtool --silent gcc -pipe -g -O2 `sh ./cflags` -c nasl_http.c
/bin/sh /home/tclahr/libnasl/libtool --silent gcc -pipe -g -O2 `sh ./cflags` -c nasl_host.c
/bin/sh /home/tclahr/libnasl/libtool --silent gcc -pipe -g -O2 `sh ./cflags` -c nasl_text_utils.c
nasl_text_utils.c: In function `nasl_split':
nasl_text_utils.c:966: warning: assignment makes pointer from integer without a cast
nasl_text_utils.c: In function `nasl_stridx':
nasl_text_utils.c:1167: warning: assignment makes pointer from integer without a cast
nasl_text_utils.c: In function `nasl_str_replace':
nasl_text_utils.c:1218: warning: assignment makes pointer from integer without a cast

In GNU's libc memmem is defined as: extern void *memmem (__const void *__haystack, size_t __haystacklen, _const void *__needle, size_t __needlelen)

Since the variables given to memmem in nasl_text_utils are defined as int they probably should be better defined as size_t in order to fix these warnings.


/bin/sh /home/tclahr/libnasl/libtool --silent gcc -pipe -g -O2 `sh ./cflags` -c nasl_nessusd_glue.c
/bin/sh /home/tclahr/libnasl/libtool --silent gcc -pipe -g -O2 `sh ./cflags` -c nasl_misc_funcs.c
nasl_misc_funcs.c: In function `nasl_sort_array':
nasl_misc_funcs.c:552: warning: passing arg 4 of `qsort' from incompatible pointer type

/usr/include/stdlib.h:extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar);


This is because the var_cmp function does not seem to follow the prototype. In GNU's libc is:
typedef int (*__compar_fn_t) (__const void *, __const void *);


Not sure how to fix this, but it's only a warning...


/bin/sh /home/tclahr/libnasl/libtool --silent gcc -pipe -g -O2 `sh ./cflags` -c capture_packet.c
bison -d -v -t -p nasl nasl_grammar.y
/bin/sh /home/tclahr/libnasl/libtool --silent gcc -pipe -g -O2 `sh ./cflags` -c nasl_grammar.tab.c
/usr/local/share/bison.simple: In function `naslparse':
/usr/local/share/bison.simple:219: number of arguments doesn't match prototype
/usr/local/share/bison.simple:153: prototype declaration
nasl_grammar.y:282: too many arguments to function `naslparse'
nasl_grammar.y:380: warning: passing arg 4 of `alloc_expr_cell' from incompatible pointer type
nasl_grammar.y:381: warning: passing arg 4 of `alloc_expr_cell' from incompatible pointer type
make[1]: *** [nasl_grammar.tab.o] Error 1
make[1]: Leaving directory `/home/tclahr/libnasl/nasl'
make: *** [all] Error 2


Anyone has an idea?


This seems to be a problem with the bison version you are using, the precise line in the nasl_grammar.y file my system (generated with bison 1.35) is:
if (! naslparse(&subctx))
which does match the declaration (naslparse -> yyparse, which is defined as 'int yyparse (void *);').
Could you send line 282 of nasl_grammar.y?
Maybe you could try to generate the grammar with a different (newer?) version of bison. That might be the problem.


Regards

Javi


[1] Google returns this: http://nscp.upenn.edu/aix4.3html/libs/commtrf2/getsockopt.htm




Reply via email to