Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Mar 1996 22:32:53 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, terry@lambert.org
Cc:        freebsd-current@freebsd.org, j@uriah.heep.sax.de
Subject:   Re: lint
Message-ID:  <199603281132.WAA28396@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> ... 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 */

>Hmmmmmmm.... that's interesting, actually.

>But if that worked, then you could make "exit" intrinsically work
>without the NOTREACHED (or the __dead or __dead2).

Only if the function body for exit() or saved information about it is
visible when exit() is referenced.  This is better supported for lint
than for cc.  Anyway, if the saved information for cc is kept in a
header file (and it should be so that people and lints can read it),
then it should't be in the form of a comment since comments shouldn't
affect the code.

>Could you:

>#define	exit( x)	lint_exit(x);		\
>			/* NOTREACHED*/

>And make sure the lint lib defined lint_exit, and not exit?

Not quite.  lint_exit() is in the application namespace, and
applications may use (exit)(x) to avoid getting the macro version.

Bruce



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