From owner-freebsd-bugs@FreeBSD.ORG Fri Oct 12 11:40:01 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6C04AB04 for ; Fri, 12 Oct 2012 11:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [8.8.178.135]) by mx1.freebsd.org (Postfix) with ESMTP id 1A7A48FC16 for ; Fri, 12 Oct 2012 11:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q9CBe09Q097333 for ; Fri, 12 Oct 2012 11:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q9CBe0en097326; Fri, 12 Oct 2012 11:40:00 GMT (envelope-from gnats) Resent-Date: Fri, 12 Oct 2012 11:40:00 GMT Resent-Message-Id: <201210121140.q9CBe0en097326@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Erik Cederstrand Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3705E928 for ; Fri, 12 Oct 2012 11:33:58 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 211F38FC16 for ; Fri, 12 Oct 2012 11:33:58 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q9CBXvU4098857 for ; Fri, 12 Oct 2012 11:33:57 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q9CBXvcX098853; Fri, 12 Oct 2012 11:33:57 GMT (envelope-from nobody) Message-Id: <201210121133.q9CBXvcX098853@red.freebsd.org> Date: Fri, 12 Oct 2012 11:33:57 GMT From: Erik Cederstrand To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/172636: usr.bin/ar: mark bsdar_errc() as __noreturn__ X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 11:40:01 -0000 >Number: 172636 >Category: misc >Synopsis: usr.bin/ar: mark bsdar_errc() as __noreturn__ >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Oct 12 11:40:00 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Erik Cederstrand >Release: CURRENT >Organization: >Environment: >Description: ar(1) contains a custom error function that calls exit() unconditionally. The definition of this function in the ar.h header file does not mark this file as non-returning. Marking it as such helps compilers reason about code. Example: http://scan.freebsd.your.org/freebsd-head/usr.bin.ar/2012-10-03-amd64/report-5ffw6K.html.gz#EndPath (false positive originating in step 31). >How-To-Repeat: >Fix: See patch Patch attached with submission follows: Index: head/usr.bin/ar/ar.h =================================================================== --- head/usr.bin/ar/ar.h (revision 241438) +++ head/usr.bin/ar/ar.h (working copy) @@ -111,7 +111,7 @@ }; void bsdar_errc(struct bsdar *, int _eval, int _code, - const char *fmt, ...); + const char *fmt, ...) __attribute__ ((__noreturn__)); void bsdar_warnc(struct bsdar *, int _code, const char *fmt, ...); void ar_mode_d(struct bsdar *bsdar); void ar_mode_m(struct bsdar *bsdar); >Release-Note: >Audit-Trail: >Unformatted: