Unix Programming - using lint

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > November 2004 > using lint





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author using lint
brian

2004-11-24, 2:59 am

I just started using lint, and I am having some problems.

I am using a non-standard library, and I keep receiving
define errors.

How do I use lint, so that it will find the libraries I
am using?

Thanks,

Brian
Fletcher Glenn

2004-11-24, 2:59 am


"brian" <tweaker@cox.net> wrote in message
news:zPTod.83889$SW3.32185@fed1read01...
>I just started using lint, and I am having some problems.
>
> I am using a non-standard library, and I keep receiving
> define errors.
>
> How do I use lint, so that it will find the libraries I
> am using?
>
> Thanks,
>
> Brian


It's been years since I've used lint (it doesn't work on C++). However, I
recall you need to create lint libraries if they do not already exist. See
your lint and compiler man pages.

--

Fletcher Glenn


brian

2004-11-24, 2:59 am

Fletcher Glenn wrote:
>
>
> It's been years since I've used lint (it doesn't work on C++). However, I
> recall you need to create lint libraries if they do not already exist. See
> your lint and compiler man pages.
>
> --
>
> Fletcher Glenn


I have gone through all the man pages. I'm using gcc 2.95 (propolice)
on openBSD. And I'm writing C, not C++.

I'm compiling with the following options:

cc -Wall -Wcast-align -O2 -ggdb -ansi -pedantic

What I do not understand is how to create lint libraries that will pick
up the definitions from my non-standard libraries (libpcap, libnet,
libdnet). That is where I am stuck.

Thanks,

Brian


Thomas Dickey

2004-11-26, 5:50 pm

brian <tweaker@cox.net> wrote:

> I have gone through all the man pages. I'm using gcc 2.95 (propolice)
> on openBSD. And I'm writing C, not C++.


> I'm compiling with the following options:


> cc -Wall -Wcast-align -O2 -ggdb -ansi -pedantic


> What I do not understand is how to create lint libraries that will pick
> up the definitions from my non-standard libraries (libpcap, libnet,
> libdnet). That is where I am stuck.


Usually that's done by calling lint with appropriate options, rather
than the compiler. (I don't have a recent OpenBSD to investigate this
on, so this is just general comments). Generally, lint programs have
the ability to "compile" C source into ".ln" files. That's inefficient
if you're trying to make libraries, so it can (sometimes needs help)
compile sources such as the "llib-lc" file that you may have seen into a
corresponding llib-lc.ln file.

It's been a while since I've done that - got out of the habit since
Solaris and IRIX64(*) went through several releases without providing a
usable lint program. I do use the llib-* files in ncurses for
documenting the interface, generating those using cproto, and make some
fixes manually. The resulting files "can" be compiled into ".ln" files
- but that may/may not be applicable for OpenBSD.

See
http://invisible-island.net/cproto/
http://invisible-island.net/ncurses/

for the examples

(*) ditto for FreeBSD/NetBSD/OpenBSD - lint's gone out of style. But I use
it when it works.

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com