From nobody@FreeBSD.org  Fri Oct 12 11:33:58 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 3705E928
	for <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <erik@cederstrand.dk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: usr.bin/ar: mark bsdar_errc() as __noreturn__
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         172636
>Category:       bin
>Synopsis:       usr.bin/ar: mark bsdar_errc() as __noreturn__
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    eadler
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 12 11:40:00 UTC 2012
>Closed-Date:    Sun Feb 03 03:47:32 UTC 2013
>Last-Modified:  Sun Feb 03 03:47:32 UTC 2013
>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:
Responsible-Changed-From-To: freebsd-bugs->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Fri Oct 12 14:37:47 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172636 
State-Changed-From-To: open->analyzed 
State-Changed-By: eadler 
State-Changed-When: Sat Oct 20 23:23:36 UTC 2012 
State-Changed-Why:  
awaiting approval or review prior to commit (no action needed from 
submitter) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172636 
State-Changed-From-To: analyzed->patched 
State-Changed-By: eadler 
State-Changed-When: Mon Oct 22 02:17:21 UTC 2012 
State-Changed-Why:  
committed in r241827 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172636 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Sun Feb 3 03:47:31 UTC 2013 
State-Changed-Why:  
I shall not MFC this PR 

http://www.freebsd.org/cgi/query-pr.cgi?pr=172636 
>Unformatted:
