Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2012 11:33:57 GMT
From:      Erik Cederstrand <erik@cederstrand.dk>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/172636: usr.bin/ar: mark bsdar_errc() as __noreturn__
Message-ID:  <201210121133.q9CBXvcX098853@red.freebsd.org>
Resent-Message-ID: <201210121140.q9CBe0en097326@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210121133.q9CBXvcX098853>