misc/172977: aic7xxx: Mark stop() function as noreturn
Erik Cederstrand
erik at cederstrand.dk
Tue Oct 23 10:20:01 UTC 2012
>Number: 172977
>Category: misc
>Synopsis: 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:
>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:
More information about the freebsd-bugs
mailing list