diff options
author | Karel Zak | 2013-07-09 10:44:06 +0200 |
---|---|---|
committer | Karel Zak | 2013-07-09 10:44:06 +0200 |
commit | c9678832b15065f9a0147c308ed79d00f8d4237a (patch) | |
tree | 5a6162e5609dcc5c4be20c774ffe8dfe0eb96737 /include/xalloc.h | |
parent | lsblk: use devno to check if the filesystem is mounted (diff) | |
download | kernel-qcow2-util-linux-c9678832b15065f9a0147c308ed79d00f8d4237a.tar.gz kernel-qcow2-util-linux-c9678832b15065f9a0147c308ed79d00f8d4237a.tar.xz kernel-qcow2-util-linux-c9678832b15065f9a0147c308ed79d00f8d4237a.zip |
include/xalloc: add warn_unused_result to allocation functions
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/xalloc.h')
-rw-r--r-- | include/xalloc.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/xalloc.h b/include/xalloc.h index 6342793e4..105d713b1 100644 --- a/include/xalloc.h +++ b/include/xalloc.h @@ -49,7 +49,7 @@ void *xcalloc(const size_t nelems, const size_t size) return ret; } -static inline char *xstrdup(const char *str) +static inline char __attribute__((warn_unused_result)) *xstrdup(const char *str) { char *ret; @@ -63,7 +63,7 @@ static inline char *xstrdup(const char *str) return ret; } -static inline char *xstrndup(const char *str, size_t size) +static inline char * __attribute__((warn_unused_result)) xstrndup(const char *str, size_t size) { char *ret; @@ -92,7 +92,7 @@ static inline int __attribute__ ((__format__(printf, 2, 3))) } -static inline char *xgethostname(void) +static inline char * __attribute__((warn_unused_result)) xgethostname(void) { char *name; size_t sz = get_hostname_max() + 1; |