(sc->flags & SCF_PARSER_FRIENDLY)? &pfpb : &pb;
char *msg = stat_item_values[item_num];
if (!b->buf)
- WRITE_STATUS_ITEM(b, item_num, "%s\n",
+ (void)WRITE_STATUS_ITEM(b, item_num, "%s\n",
msg? msg : "");
ret = write(fd, b->buf, b->offset);
if (ret == b->offset)
char *item = stat_item_values[i];
if (!((one << i) & mask))
continue;
- WRITE_STATUS_ITEM(&b, i, "%s\n", item? item : "");
+ (void)WRITE_STATUS_ITEM(&b, i, "%s\n", item? item : "");
}
ret = client_write(fd, b.buf);
if (ret >= 0)
strftime(mtime, 29, "%b %d %Y", &mtime_tm);
}
gettimeofday(¤t_time, NULL);
- WRITE_STATUS_ITEM(&b, SI_FILE_SIZE, "%zu\n", nmmd->size / 1024);
- WRITE_STATUS_ITEM(&b, SI_MTIME, "%s\n", mtime);
- WRITE_STATUS_ITEM(&b, SI_STATUS, "%s\n", status);
- WRITE_STATUS_ITEM(&b, SI_STATUS_FLAGS, "%s\n", flags);
- WRITE_STATUS_ITEM(&b, SI_OFFSET, "%li\n", offset);
- WRITE_STATUS_ITEM(&b, SI_AFS_MODE, "%s\n", mmd->afs_mode_string);
- WRITE_STATUS_ITEM(&b, SI_STREAM_START, "%lu.%lu\n",
+ /*
+ * The calls to WRITE_STATUS_ITEM() below never fail because
+ * b->max_size is zero (unlimited), see para_printf(). However, clang
+ * is not smart enough to prove this and complains nevertheless.
+ * Casting the return value to void silences solves this.
+ */
+ (void)WRITE_STATUS_ITEM(&b, SI_FILE_SIZE, "%zu\n", nmmd->size / 1024);
+ (void)WRITE_STATUS_ITEM(&b, SI_MTIME, "%s\n", mtime);
+ (void)WRITE_STATUS_ITEM(&b, SI_STATUS, "%s\n", status);
+ (void)WRITE_STATUS_ITEM(&b, SI_STATUS_FLAGS, "%s\n", flags);
+ (void)WRITE_STATUS_ITEM(&b, SI_OFFSET, "%li\n", offset);
+ (void)WRITE_STATUS_ITEM(&b, SI_AFS_MODE, "%s\n", mmd->afs_mode_string);
+ (void)WRITE_STATUS_ITEM(&b, SI_STREAM_START, "%lu.%lu\n",
(long unsigned)nmmd->stream_start.tv_sec,
(long unsigned)nmmd->stream_start.tv_usec);
- WRITE_STATUS_ITEM(&b, SI_CURRENT_TIME, "%lu.%lu\n",
+ (void)WRITE_STATUS_ITEM(&b, SI_CURRENT_TIME, "%lu.%lu\n",
(long unsigned)current_time.tv_sec,
(long unsigned)current_time.tv_usec);
free(flags);