From nobody@FreeBSD.org  Tue Oct 23 10:19:36 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 7331C62C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 23 Oct 2012 10:19:36 +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 5BD8B8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 23 Oct 2012 10:19:36 +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 q9NAJZcH090561
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 23 Oct 2012 10:19:35 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id q9NAJZne090557;
	Tue, 23 Oct 2012 10:19:35 GMT
	(envelope-from nobody)
Message-Id: <201210231019.q9NAJZne090557@red.freebsd.org>
Date: Tue, 23 Oct 2012 10:19:35 GMT
From: Erik Cederstrand <erik@cederstrand.dk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: aic7xxx: Mark stop() function as noreturn
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         172977
>Category:       kern
>Synopsis:       [aic7xxx] [patch] aic7xxx: Mark stop() function 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:   Tue Oct 23 10:20:00 UTC 2012
>Closed-Date:    
>Last-Modified:  Sun Apr 20 02:45:18 UTC 2014
>Originator:     Erik Cederstrand
>Release:        CURRENT
>Organization:
>Environment:
>Description:
The stop() function prototype in head/sys/dev/aic7xxx/aicasm/aicasm.h does not hint that the implementation of the function unconditionally calls exit(). This causes false positive Clang Static Analyzer reports.
>How-To-Repeat:

>Fix:
Add __attribute__ ((__noreturn__)) to the declaration.

Patch attached with submission follows:

Index: head/sys/dev/aic7xxx/aicasm/aicasm.h
===================================================================
--- head/sys/dev/aic7xxx/aicasm/aicasm.h	(revision 241876)
+++ head/sys/dev/aic7xxx/aicasm/aicasm.h	(working copy)
@@ -82,7 +82,7 @@
 extern int   dst_mode;
 struct symbol;
 
-void stop(const char *errstring, int err_code);
+void stop(const char *errstring, int err_code) __attribute__ ((__noreturn__));
 void include_file(char *file_name, include_type type);
 void expand_macro(struct symbol *macro_symbol);
 struct instruction *seq_alloc(void);

>Release-Note:
>Audit-Trail:
>Unformatted:
