Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!ukma!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: 2 lint questions Message-ID: <10622@smoke.BRL.MIL> Date: 28 Jul 89 19:35:06 GMT References: <5967@ingr.com> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 23 In article <5967@ingr.com> boyd@ingr.com (Boyd Nation) writes: -1) How does one prevent lint from issuing a warning message about possible -pointer alignment problems given the following line of code: - x = (blivet *)malloc(sizeof(blivet)); The only way is to substitute different code under "#ifdef lint" control. If you actually plan on doing that, I recommend using a nice macro wrapper defined to implement the actual malloc() call with casts etc. normally but defined with a lint-free substitute under "#ifdef lint" conditions. -2) Is there any way to get lint to detect a closed loop of code which can -never be called? For example: - void func1() - { - func2(); - } - void func2() - { - func1(); - } -where there are no other calls to func1 or func2. Nope.