Subject: [clisp-list] FFI interface problems in upgrading from 2.7x to 3.x

From: Fred Cohen <[email-masked]>
Date: Tue Sep 9 12:35:10 2003

I am trying to get an FFI interface program that ran under an old
version to run under the latest stable version and am running into some
problems as follows:

Compiling file /u/fc/src/Responder/call-rawsock.lisp ...

Wrote file /u/fc/src/Responder/call-rawsock.fas
Wrote file /u/fc/src/Responder/call-rawsock.c
0 errors, 0 warnings

gcc -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type
-fomit-frame-pointer -Wno-sign-compare -O2 -fexpensive-optimizations
-DUNICODE -DDYNAMIC_FFI -DNO_SIGSEGV -I.  -I/usr/local/lib/clisp/linkkit
-c call-rawsock.c

In file included from call-rawsock.c:1:

/usr/local/lib/clisp/linkkit/clisp.h:3100:22: constobj.c: No such file or directory

make: *** [call-rawsock.o] Error 1

The only version of this file I can find is in the clisp source tree
and when I artificially force this to be the included file I get:

Wrote file /u/fc/src/Responder/call-rawsock.fas
Wrote file /u/fc/src/Responder/call-rawsock.c
0 errors, 0 warnings
gcc -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit -Wreturn-type  -fomit-frame-pointer -Wno-sign-compare -O2 -fexpensive-optimizations -DUNICODE -DDYNAMIC_FFI -DNO_SIGSEGV -I. -I/usr/local/lib/clisp/linkkit -c call-rawsock.c
In file included from call-rawsock.c:1:
/usr/local/lib/clisp/linkkit/clisp.h:543: warning: register used for two global register variables
/usr/local/lib/clisp/linkkit/clisp.h:555: parse error before `)'
/usr/local/lib/clisp/linkkit/clisp.h:555: warning: type defaults to `int' in declaration of `finish_frame'
/usr/local/lib/clisp/linkkit/clisp.h:555: warning: parameter names (without types) in function declaration
/usr/local/lib/clisp/linkkit/clisp.h:555: warning: data definition has no type or storage class
/usr/local/lib/clisp/linkkit/clisp.h:555: parse error before `}'
/usr/local/lib/clisp/linkkit/clisp.h:555: warning: type defaults to `int' in declaration of `callback_saved_registers'
/usr/local/lib/clisp/linkkit/clisp.h:555: conflicting types for `callback_saved_registers'
/usr/local/lib/clisp/linkkit/clisp.h:221: previous declaration of `callback_saved_registers'
/usr/local/lib/clisp/linkkit/clisp.h:555: `registers' undeclared here (not in a function)
/usr/local/lib/clisp/linkkit/clisp.h:555: warning: data definition has no type or storage class
/usr/local/lib/clisp/linkkit/clisp.h:555: parse error before `}'
/usr/local/lib/clisp/linkkit/clisp.h:555: warning: type defaults to `int' in declaration of `saved_STACK'
/usr/local/lib/clisp/linkkit/clisp.h:555: conflicting types for `saved_STACK'
/usr/local/lib/clisp/linkkit/clisp.h:545: previous declaration of `saved_STACK'
/usr/local/lib/clisp/linkkit/clisp.h:555: warning: initialization makes integer from pointer without a cast
/usr/local/lib/clisp/linkkit/clisp.h:555: warning: data definition has no type or storage class
/usr/local/lib/clisp/linkkit/clisp.h:563: warning: type defaults to `int' in declaration of `CK_reg'
/usr/local/lib/clisp/linkkit/clisp.h:563: `registers' undeclared here (not in a function)
/usr/local/lib/clisp/linkkit/clisp.h:563: warning: data definition has no type or storage class
/usr/local/lib/clisp/linkkit/clisp.h:563: parse error before `}'
In file included from call-rawsock.c:1:
/usr/local/lib/clisp/linkkit/clisp.h:3127: parse error before `*'
/usr/local/lib/clisp/linkkit/clisp.h:3127: warning: `struct mod' declared inside parameter list
/usr/local/lib/clisp/linkkit/clisp.h:3127: warning: its scope is only this definition or declaration, which is probably not what you want.
/usr/local/lib/clisp/linkkit/clisp.h:3198: parse error before `#'
/usr/local/lib/clisp/linkkit/clisp.h:3198: warning: type defaults to `int' in declaration of `_sstring_alloca'
/usr/local/lib/clisp/linkkit/clisp.h:3198: warning: data definition has no type or storage class
/usr/local/lib/clisp/linkkit/clisp.h:3198: parse error before `#'
/usr/local/lib/clisp/linkkit/clisp.h:3198: parse error before `#'
/usr/local/lib/clisp/linkkit/clisp.h:3205: warning: type defaults to `int' in declaration of `cstombs_f'
/usr/local/lib/clisp/linkkit/clisp.h:3205: conflicting types for `cstombs_f'
/usr/local/lib/clisp/linkkit/clisp.h:3190: previous declaration of `cstombs_f'
/usr/local/lib/clisp/linkkit/clisp.h:3205: warning: data definition has no type or storage class
/usr/local/lib/clisp/linkkit/clisp.h:3205: parse error before `#'
/usr/local/lib/clisp/linkkit/clisp.h:3213: parse error before `#'
/usr/local/lib/clisp/linkkit/clisp.h:3213: parse error before `#'
/usr/local/lib/clisp/linkkit/clisp.h:3220: warning: type defaults to `int' in declaration of `cstombs_f'
/usr/local/lib/clisp/linkkit/clisp.h:3220: warning: data definition has no type or storage class
/usr/local/lib/clisp/linkkit/clisp.h:3220: parse error before `#'
/usr/local/lib/clisp/linkkit/clisp.h:3248: parse error before `('
/usr/local/lib/clisp/linkkit/clisp.h:3255: parse error before `_unpacked_'
/usr/local/lib/clisp/linkkit/clisp.h:3255: warning: type defaults to `int' in declaration of `_unpacked_'
/usr/local/lib/clisp/linkkit/clisp.h:3255: warning: data definition has no type or storage class
/usr/local/lib/clisp/linkkit/clisp.h:3268: parse error before `d_function'
/usr/local/lib/clisp/linkkit/clisp.h:3275: parse error before `condition'
In file included from call-rawsock.c:1:
/usr/local/lib/clisp/linkkit/clisp.h:3382: warning: This file contains more `}'s than `{'s.
call-rawsock.c: In function `module__call_rawsock__init_function_2':
call-rawsock.c:19: `buffer' undeclared (first use in this function)
call-rawsock.c:19: (Each undeclared identifier is reported only once
call-rawsock.c:19: for each function it appears in.)
call-rawsock.c:20: `from' undeclared (first use in this function)
call-rawsock.c:21: `f' undeclared (first use in this function)
call-rawsock.c:22: `timestamp' undeclared (first use in this function)
call-rawsock.c:23: `ts' undeclared (first use in this function)
call-rawsock.c:24: `rawsocket' undeclared (first use in this function)
call-rawsock.c:25: `closesock' undeclared (first use in this function)
call-rawsock.c:26: `ipcsum' undeclared (first use in this function)
call-rawsock.c:27: `icmpcsum' undeclared (first use in this function)
call-rawsock.c:28: `tcpcsum' undeclared (first use in this function)
call-rawsock.c:29: `udpcsum' undeclared (first use in this function)
call-rawsock.c:30: `recvfr' undeclared (first use in this function)
call-rawsock.c:31: `sendt' undeclared (first use in this function)
call-rawsock.c:32: `gettime' undeclared (first use in this function)
call-rawsock.c:33: `backup' undeclared (first use in this function)
call-rawsock.c:34: `restore' undeclared (first use in this function)
call-rawsock.c:35: `configdev' undeclared (first use in this function)
call-rawsock.c:36: `perror' undeclared (first use in this function)
make: *** [call-rawsock.o] Error 1

Now of course this stuff worked without a problem in the previous
version I was using, so IU was wondering if I missed a critical step or
some such thing. 

Any assistance would be greatly appreciated.  Please cc me directly at
my email address. (fc at all.net)

-- This communication is confidential to the parties it is intended to serve --
Fred Cohen - http://all.net/ - [email-masked] - [email-masked] - tel/fax: 925-454-0171
Fred Cohen & Associates	- University of New Haven - Security Posture

---

From: Sam Steingold <[email-masked]>
Date: Tue Sep 9 16:04:48 2003

>* Fred Cohen <[email-masked]> [2003-09-09 10:33:27 -0700]:

first, what are "2.7x" & "3.x"?

> Compiling file /u/fc/src/Responder/call-rawsock.lisp ...

just out of curiosity, what does your module do?

> /usr/local/lib/clisp/linkkit/clisp.h:3100:22: constobj.c: No such file or directory

oops.  bug.  sorry.
please remove the line in clisp.h that includes constobj.c.

> /usr/local/lib/clisp/linkkit/clisp.h:555: parse error before `)'

could you please look at clisp.h and try to figure out what is wrong there?
I see nothing wrong in my file.

> version I was using, so IU was wondering if I missed a critical step
> or some such thing.

No, of course, this stuff worked without a problem in the built-in
modules with which CLISP is distributed, so I am wondering if I missed
a critical step or some such thing :-)

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.honestreporting.com>
MS Windows: error: the operation completed successfully.