summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-08-08 09:58:50 (GMT)
committerThomas Haller <thaller@redhat.com>2016-08-14 07:57:25 (GMT)
commitf6b7a7f974c3eaadc9d4705d61780de6a7009854 (patch)
tree563d9fdcc9a7454888b742c43da8198dd87367e3
parentc52087601198f3fb8ec97839e30c6f6309f0d680 (diff)
downloadlibnl-f6b7a7f974c3eaadc9d4705d61780de6a7009854.zip
libnl-f6b7a7f974c3eaadc9d4705d61780de6a7009854.tar.gz
libnl-f6b7a7f974c3eaadc9d4705d61780de6a7009854.tar.bz2
cli: add noreturn attributes
Teach static code analyzers (such as Clang static analyzer) that code following nl_cli_fatal can never be executed. Avoids false positives such as detecting use of NULL pointers when that cannot happen. Signed-off-by: Peter Wu <peter@lekensteyn.nl> Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--include/netlink/cli/utils.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/netlink/cli/utils.h b/include/netlink/cli/utils.h
index ea89fc6..4c28343 100644
--- a/include/netlink/cli/utils.h
+++ b/include/netlink/cli/utils.h
@@ -61,8 +61,10 @@ extern "C" {
#endif
extern uint32_t nl_cli_parse_u32(const char *);
-extern void nl_cli_print_version(void);
-extern void nl_cli_fatal(int, const char *, ...);
+extern void nl_cli_print_version(void)
+ __attribute__((noreturn));
+extern void nl_cli_fatal(int, const char *, ...)
+ __attribute__((noreturn));
extern struct nl_addr * nl_cli_addr_parse(const char *, int);
extern int nl_cli_connect(struct nl_sock *, int);
extern struct nl_sock * nl_cli_alloc_socket(void);