Date: Sun, 30 Aug 2015 11:53:00 +0200 From: Ed Schouten <ed@nuxi.nl> To: Joerg Sonnenberger <joerg@britannica.bec.de> Cc: Bruce Evans <brde@optusnet.com.au>, Xin LI <delphij@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers <src-committers@freebsd.org> Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd Message-ID: <CABh_MK=yp4rFyjYYafc4UNM1_MCBa%2BdUxS917T7KQJHV%2BoLizw@mail.gmail.com> In-Reply-To: <20150828143847.GA24222@britannica.bec.de> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> <20150828215109.G1227@besplex.bde.org> <20150828143847.GA24222@britannica.bec.de>
next in thread | previous in thread | raw e-mail | index | archive | help
2015-08-28 16:38 GMT+02:00 Joerg Sonnenberger <joerg@britannica.bec.de>: > But the compiler can't tell if it is the *intention* that the function > never returns. The warning behavior exists because that can easily > change with macros etc. I think it's important to keep in mind what this keyword was designed for. The idea behind this attribute (and the C11 _Noreturn keyword) is to allow for propagation of optimisation state across compilation units. You use it to annotate functions in header files, so that the compiler does not need to handle function return at the call site. This knowledge can be automatically be inferred if the function is static. Whether the compiler can throw additional warnings or not based on whether this keyword is present or what the intent of the programmer is, is completely irrelevant. I agree with Bruce that this change makes little sense. I would even go as far as to say that GCC/Clang should just throw warnings if _Noreturn is used on a function that is static or used on a definition instead of a declaration. -- 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_MK=yp4rFyjYYafc4UNM1_MCBa%2BdUxS917T7KQJHV%2BoLizw>