Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Nov 1997 23:10:06 +0100
From:      j@uriah.heep.sax.de (J Wunsch)
To:        freebsd-current@FreeBSD.ORG
Subject:   Re: LINT Errors
Message-ID:  <19971105231006.RB35366@uriah.heep.sax.de>
In-Reply-To: <XFMail.971104010703.Shimon@i-Connect.Net>; from Simon Shapiro on Nov 4, 1997 01:07:03 -0800
References:  <XFMail.971104010703.Shimon@i-Connect.Net>

next in thread | previous in thread | raw e-mail | index | archive | help
As Simon Shapiro wrote:

> ../../kern/kern_malloc.c: In function `malloc':
> ../../kern/kern_malloc.c:136: warning: passing arg 3 of `tsleep' discards
> `const' from pointer target type
> ../../kern/kern_malloc.c:198: warning: assignment discards `const' from
> pointer target type
> 
> [  I admit shamelessly i do not know how t0 silence this one  ]

By changing the prototype for tsleep(9) to use `const char *' for its
third argument.  The argument is supposed to be a description, and we
do pass constant strings for it all the day.  gcc doesn't seem to warn
if you pass a string literal (albeit its arranging for the string
literal to be in the .text segment).

> ../../kern/kern_opt.c:44: warning: #warning "obsolete option GATEWAY - use
> `sysctl -w net.inet.ip.forwarding=1'"
> 
> [  Should i do as it says?  ]

Of course.

> ../../i386/i386/sys_machdep.c: In function `i386_get_ioperm':
> ../../i386/i386/sys_machdep.c:225: warning: `i' might be used uninitialized
> in this function
> 
> [  I routinely initialize these to zero  ]

...and thus only hide the actual error.  This line

	state = (iomap[i >> 3] >> (i & 7)) & 1;

seems to be superfluous.

> 
> ../../i386/isa/sound/uart6850.c: In function `poll_uart6850':
> ../../i386/isa/sound/uart6850.c:113: `timeout_func_t' undeclared (first use
> this function)
> ../../i386/isa/sound/uart6850.c:113: (Each undeclared identifier is
> reported only once
> ../../i386/isa/sound/uart6850.c:113: for each function it appears in.)
> ../../i386/isa/sound/uart6850.c:113: parse error before `poll_uart6850'
> *** Error code 1

I've already mentioned this as well.  timeout_func_t is gone, Bruce
thinks that it has only been used for bogus casts like the above.  The
actual timeout handlers should be converted to agree with the argument
types for a timeout handler, instead of just casting them when passing
down to timeout(9).

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971105231006.RB35366>