Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2012 10:21:59 GMT
From:      Erik Cederstrand <erik@cederstrand.dk>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/172978: dump: mark non-returning function quit() as such in function prototype
Message-ID:  <201210231021.q9NALxsC091416@red.freebsd.org>
Resent-Message-ID: <201210231030.q9NAU0DA073998@freefall.freebsd.org>

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

>Number:         172978
>Category:       misc
>Synopsis:       dump: mark non-returning function quit() as such in function prototype
>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:30:00 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Erik Cederstrand
>Release:        CURRENT
>Organization:
>Environment:
>Description:
Marking non-returning function prototype for quit() in head/sbin/dump/dump.h eliminates various false positives in Clang Static Analyzer reports.
>How-To-Repeat:

>Fix:
Use __noreturn__ to mark non-returning function.

Patch attached with submission follows:

Index: src/sbin/dump/dump.h
===================================================================
--- src/sbin/dump/dump.h	(revision 241876)
+++ src/sbin/dump/dump.h	(working copy)
@@ -96,7 +96,7 @@
 void	msg(const char *fmt, ...) __printflike(1, 2);
 void	msgtail(const char *fmt, ...) __printflike(1, 2);
 int	query(const char *question);
-void	quit(const char *fmt, ...) __printflike(1, 2);
+void	quit(const char *fmt, ...) __printflike(1, 2) __attribute__((__noreturn__));
 void	timeest(void);
 time_t	unctime(char *str);
 


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



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