提交 658952a3 编写于 作者: J Jim Meyering

virAsprintf: remove its warn_unused_result attribute

* src/util/util.h (virAsprintf): Remove ATTRIBUTE_RETURN_CHECK, since
it is perfectly fine to ignore the return value, now that the pointer
is guaranteed to be set to NULL upon failure.
* src/util/storage_file.c (absolutePathFromBaseFile): Remove now-
unnecessary use of ignore_value.
上级 e3042683
......@@ -27,7 +27,6 @@
#include <unistd.h>
#include <fcntl.h>
#include "dirname.h"
#include "ignore-value.h"
#include "memory.h"
#include "virterror_internal.h"
......@@ -253,7 +252,7 @@ absolutePathFromBaseFile(const char *base_file, const char *path)
if (d_len > INT_MAX)
return NULL;
ignore_value(virAsprintf(&res, "%.*s/%s", (int) d_len, base_file, path));
virAsprintf(&res, "%.*s/%s", (int) d_len, base_file, path);
return res;
}
......
......@@ -177,8 +177,7 @@ int virMacAddrCompare (const char *mac1, const char *mac2);
void virSkipSpaces(const char **str);
int virParseNumber(const char **str);
int virAsprintf(char **strp, const char *fmt, ...)
ATTRIBUTE_FMT_PRINTF(2, 3) ATTRIBUTE_RETURN_CHECK;
int virAsprintf(char **strp, const char *fmt, ...) ATTRIBUTE_FMT_PRINTF(2, 3);
char *virStrncpy(char *dest, const char *src, size_t n, size_t destbytes)
ATTRIBUTE_RETURN_CHECK;
char *virStrcpy(char *dest, const char *src, size_t destbytes)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册