[PATCH] xfsprogs: mark some functions as noreturn

Christoph Hellwig hch at infradead.org
Fri Sep 4 18:09:04 CDT 2009


On Fri, Sep 04, 2009 at 05:35:37PM -0500, Eric Sandeen wrote:
> Static checkers are a lot less noisy if they know certain
> functions are noreturn.
> 
> Making this change removed about 50 errors from "clang" output.
> (http://clang-analyzer.llvm.org) output.

Not pretty but useful,


Reviewed-by: Christoph Hellwig <hch at lst.de>

> -void	do_abort(char const *, ...);		/* abort, internal error */
> -void	do_error(char const *, ...);		/* abort, system error */
> -void	do_warn(char const *, ...);		/* issue warning */
> -void	do_log(char const *, ...);		/* issue log message */
> +/* abort, internal error */
> +void  __attribute__((noreturn)) do_abort(char const *, ...);
> +/* abort, system error */
> +void  __attribute__((noreturn)) do_error(char const *, ...);
> +/* issue warning */
> +void do_warn(char const *, ...);
> +/* issue log message */
> +void do_log(char const *, ...);

It would be good to add the proper printflike attributes to these to
also get vararg typechecking.




More information about the xfs mailing list