Date: Tue, 02 May 2000 10:53:15 +0200 From: Ernst de Haan <ernst@jollem.com> To: freebsd-java@freebsd.org Subject: Lint on the source (ps7) Message-ID: <390E977B.81C1E941@jollem.com>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
I used lint to check the source code on common errors, but the code looked
good to it. I've included the shell script I used to execute lint on the
source code (from the src/ directory). A few comments:
--1--
The declaration of sysLoadLibrary in linker_md.c is:
sysLoadLibrary(const char *name,
char *err_buf,
int err_buflen)
But I believe this should be:
sysLoadLibrary(const char *name,
char *err_buf,
size_t err_buflen)
Because the err_buflen is a size of a region in the heap (which is
typically a size_t), and because it is used as the 3rd arg in a call to
strncpy, which takes a size_t.
But this is function specified and used by Sun, so there's little that can
be done to `fix' this.
--2--
In schedule.c there is a function called lj_setcontext() that is declared
to return an int, but it does not. Is this an error? If not, why not?
--3--
Overall: Virtually all warnings generated by lint are probably nothing to
worry about. Lint reports a lot of dubious operations on enums, constants
in conditional contexts, and troublesome pointer casts :-)
Ernst
--
Ernst de Haan
Freelance Java Architect
"Come to me all who are weary and burdened,
and I will give you rest" -- Jesus Christ
[-- Attachment #2 --]
#!/bin/sh
lint -aa -b -c -e -h -p -r -u -v -z -F -H -Ishare/javavm/include -Ifreebsd/hpi/green_threads/include -Ifreebsd/hpi/export -Ishare/hpi/include -Ishare/hpi/export -Ishare/javavm/export -Ifreebsd/javavm/export -Ifreebsd/hpi/include `find freebsd/ | grep ".*\.c$" | grep -v "^freebsd/test" | grep -v "^freebsd/doc/oldnmi"`
[-- Attachment #3 --]
begin:vcard
n:de Haan;Ernst
tel;fax:+31 (0)26 3645634
tel;work:+31 (0)26 3623895
x-mozilla-html:FALSE
url:http://www.znerd.demon.nl/
org:Jollem
adr:;;Rozendaalselaan 35;Velp;GLD;6881 KZ;Netherlands
version:2.1
email;internet:ernst@jollem.com
title:Java Architect
fn:Ernst de Haan
end:vcard
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?390E977B.81C1E941>
