Skip site navigation (1)Skip section navigation (2)
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
This is a multi-part message in MIME format.
--------------498F0606055638E0F39D34FE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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
--------------498F0606055638E0F39D34FE
Content-Type: application/x-sh;
 name="execlint.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="execlint.sh"

#!/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"`

--------------498F0606055638E0F39D34FE
Content-Type: text/x-vcard; charset=us-ascii;
 name="ernst.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Ernst de Haan
Content-Disposition: attachment;
 filename="ernst.vcf"

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

--------------498F0606055638E0F39D34FE--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?390E977B.81C1E941>