Date: Tue, 23 Oct 2012 10:19:35 GMT From: Erik Cederstrand <erik@cederstrand.dk> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/172977: aic7xxx: Mark stop() function as noreturn Message-ID: <201210231019.q9NAJZne090557@red.freebsd.org> Resent-Message-ID: <201210231020.q9NAK0UB073815@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210231019.q9NAJZne090557>