From owner-freebsd-current Wed Mar 27 12:41:15 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA24901 for current-outgoing; Wed, 27 Mar 1996 12:41:15 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA24889 for ; Wed, 27 Mar 1996 12:41:10 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id HAA20036; Thu, 28 Mar 1996 07:38:51 +1100 Date: Thu, 28 Mar 1996 07:38:51 +1100 From: Bruce Evans Message-Id: <199603272038.HAA20036@godzilla.zeta.org.au> To: bde@zeta.org.au, terry@lambert.org Subject: Re: lint Cc: freebsd-current@freebsd.org, j@uriah.heep.sax.de Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >> It doesn't understand them even with -g. I think the author plans to >> fix this. There has to be a way to tell lint that certain functions >> don't return, and __attribute__((__noreturn__)) is a good way. >Putting "/* NOTREACHED*/" after the function call is the traditional >lint method... assuming this is supposed to be an implementation of >a traditional lint, instead of some new thing. Not according to lint man pages: "BUGS The routines exit(2) [sic] ... and other functions that do not return are not understood; this causes various incorrect diagnostics". /*NOTREACHED*/ only works for the function call, not for the function declaration. You have to put the comment after thousands of calls to exit() instead of after one declaration of exit. If /*NOTREACHED*/ worked to qualify function declarations, then you might be able to implement it using __dead, __dead2 or __attribute__((__noreturn__)). E.g., #define __dead /*NOTREACHED*/ /* probably misplaced */ #define __dead2 /*NOTREACHED*/ /* more likely to work */ Bruce