| Subject: | Re: __dead functions |
|---|---|
| From: | Rhialto <rhialto@xxxxxxx> |
| Date: | Tue, 22 Jul 2008 13:48:57 UTC |
| Newsgroups: | fa.netbsd.tech.kern |
On Fri 18 Jul 2008 at 21:10:13 +0400, Valeriy E. Ushakov wrote:
> Actually we can arrange for lint's /* NOTREACHED */ comment to appear
> at the end of that macro so that one macro covers "notreached"
> semantics for all the tools we use. Using an example from my previous
> mail:
>
> #ifdef __lint__
> #define __MARK_NOTREACHED /* NOTREACHED */
> #else /* !__lint__ */
> #if __GNUC_PREREQ__(4, 0)
> #define __MARK_NOTREACHED for (;;) continue
> #else
> #define __MARK_NOTREACHED do {} while (/* CONSTCOND */ 0)
> #endif
> #endif /* !__lint__ */
>
> then we can have a single
>
> __NOTREACHED;
>
> statement in the code that will cover lint, gcc, and anything else we
> might need to use in the future.
That won't actually work, since comments are removed in translation
phase 3 and macros are expanded in translation phase 4, so after the
comments are gone.
See section 5.1.1.2 in
http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2000/n1252.pdf (page
10; page 22 of the pdf)
-Olaf.
--
___ Olaf 'Rhialto' Seibert -- You author it, and I'll reader it.
\X/ rhialto/at/xs4all.nl -- Cetero censeo "authored" delendum esse.
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: kernel panic (4.99.69), 6bone |
|---|---|
| Next by Date: | Re: __dead functions, Valeriy E. Ushakov |
| Previous by Thread: | Re: __dead functions, Alexander Shishkin |
| Next by Thread: | Re: __dead functions, Valeriy E. Ushakov |
| Indexes: | [Date] [Thread] [Top] [All Lists] |