From owner-svn-src-head@freebsd.org Sun Aug 30 09:58:11 2015 Return-Path: Delivered-To: svn-src-head@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 86EBF9C4FEF for ; Sun, 30 Aug 2015 09:58:11 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yk0-f172.google.com (mail-yk0-f172.google.com [209.85.160.172]) (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 507EE10C3 for ; Sun, 30 Aug 2015 09:58:10 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by ykfw127 with SMTP id w127so2361216ykf.1 for ; Sun, 30 Aug 2015 02:58:04 -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=TU+j2jk6FBZE0v1GuS6kDfqPnSy6SqO3jVlAvq1potWTiZqtnUcc7ZLCKOqL/OlaxJ vmfzEIRi7l37Vd9uwfsv53eDWZqH/xZ9vpQByLMAulULQiqmEnpLnoMwT8fB2r/sszlz SYg/iCa0hiaxILNW1T8RXXxPd+3X5oo0wkVeRAFq6Zxao762AIWJ3dPfLHgJJ5opUx+v BU+MdgTw9lROsFsciaqFQoNodiFlH2uZlyd+zF9qIsxFBQVkls9rwClua9I843zwRB2o 1f/GTSKfxlnZcOXEVwfWVBAD2v/lrXVg1XNUBikdfaAEuY35mlvz7nWkrqDc5YPVowgS TXjQ== X-Gm-Message-State: ALoCoQn8NXAQwQ2vBnLnJtk3RHScVumRp7U+EeKyiWsEdU8ajOaW7rerawTFVrQKA001BXnnvm+5 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-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Aug 2015 09:58:11 -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