From owner-svn-src-all@freebsd.org Sun Aug 30 09:53:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A1D29C4D0A for ; Sun, 30 Aug 2015 09:53:08 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yk0-f173.google.com (mail-yk0-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13A3AE78 for ; Sun, 30 Aug 2015 09:53:07 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by ykbu129 with SMTP id u129so21367524ykb.2 for ; Sun, 30 Aug 2015 02:53:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=x8LARGHCL01ANF6lnRA5Z+YIgRR0hR56n/+mY661S2o=; b=Ve7aedfveqgDzOiK9DlJvWyOn/mduMxN8YQT8bEXsXEh2aCEIdMDnLR9Kr5noPq50Z AkeWypHuNxFRfNAIdQWIUDq2ZLDIqd9V2NFcdrrDonrMRNksbVNoxVYEKL/fDpR9jPvx Jdj0gaW0yNjU/ObZInh3ZX0K6iNzCrkMVl0EoHQDck+T38VPKwgTs9e2Vb6TTt7lTeIk Q453LEvuYj9aQqu0PeI6VuuDxl5sRWW25TiqfXsdf/r/AAE91cRurhyiAQ/0joUwMFLb yia/vkm7/Sb7vFaP4yO4SdGvtO1bd+NvdMVxsyj14DHbEbKYNP7RF5kcvVM+YvhVZICX FSew== X-Gm-Message-State: ALoCoQm/di0N87DUbpYyqsoellDZnnM/fMR3xijMy3q1opgfFmxIq4M/5vnq27YCvM8b/JdXm2Qo MIME-Version: 1.0 X-Received: by 10.170.117.22 with SMTP id j22mr1303448ykb.79.1440928380346; Sun, 30 Aug 2015 02:53:00 -0700 (PDT) Received: by 10.129.113.67 with HTTP; Sun, 30 Aug 2015 02:53:00 -0700 (PDT) X-Originating-IP: [84.27.222.46] In-Reply-To: <20150828143847.GA24222@britannica.bec.de> References: <201508271811.t7RIB0xl077002@repo.freebsd.org> <20150828215109.G1227@besplex.bde.org> <20150828143847.GA24222@britannica.bec.de> Date: Sun, 30 Aug 2015 11:53:00 +0200 Message-ID: Subject: Re: svn commit: r287217 - head/usr.sbin/syslogd From: Ed Schouten To: Joerg Sonnenberger Cc: Bruce Evans , Xin LI , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Aug 2015 09:53:08 -0000 2015-08-28 16:38 GMT+02:00 Joerg Sonnenberger : > 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 Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717