Date: Sun, 29 May 2016 12:39:27 +0200 From: Ed Schouten <ed@nuxi.nl> To: Bruce Evans <brde@optusnet.com.au> Cc: Garrett Cooper <ngie@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300935 - head/usr.sbin/rpc.statd Message-ID: <CABh_MKmoPmGCtnUvhjvb5YmUEU8bZsM0cwWcJG0C2QfD4VmvCg@mail.gmail.com> In-Reply-To: <20160529171235.A1958@besplex.bde.org> References: <201605290418.u4T4IlWI057643@repo.freebsd.org> <20160529171235.A1958@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Bruce, Garrett, 2016-05-29 9:31 GMT+02:00 Bruce Evans <brde@optusnet.com.au>: > On Sun, 29 May 2016, Garrett Cooper wrote: > >> Log: >> Mark out_of_mem(..) and usage(..) with __dead2 as they both directly call >> exit >> as a hint to static analysis tools > > This is bogus for usage() since it is static so only very broken static > analyis tools can't see its full details. Exactly. I think it's important to keep in mind what the intent of this attribute is: to pass compiler optimization state across compilation units. For static functions, this has absolutely no meaning. Also, as we already live in the year 2016, please use the following construct in case you really want to mark this function as no-return: #include <stdnoreturn.h> static noreturn void usage(void) { ... } In public header files where you likely don't want to pollute the namespace, use _Noreturn instead. Thanks, -- Ed Schouten <ed@nuxi.nl> Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CABh_MKmoPmGCtnUvhjvb5YmUEU8bZsM0cwWcJG0C2QfD4VmvCg>