]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - command.c
manual: Mention that clang is also a supported compiler.
[paraslash.git] / command.c
index 1a090e49d71bb3d1ff3545236265f4c052bf83fe..69bbbb74dd2831791e0f24378d7a4c4451bb6524 100644 (file)
--- a/command.c
+++ b/command.c
@@ -34,6 +34,7 @@
 #include "afs_command_list.h"
 #include "sched.h"
 #include "signal.h"
+#include "version.h"
 
 /** Commands including options must be shorter than this. */
 #define MAX_COMMAND_LEN 32768
@@ -121,16 +122,22 @@ static char *get_status(struct misc_meta_data *nmmd, int parser_friendly)
                strftime(mtime, 29, "%b %d %Y", &mtime_tm);
        }
        gettimeofday(&current_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);