]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
perfglue: Silence truncation warning
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 8 May 2018 21:19:38 +0000 (17:19 -0400)
committerNathan Cutler <ncutler@suse.com>
Fri, 18 May 2018 13:30:35 +0000 (15:30 +0200)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit a0d15b915f8092f9cfcd19a700e7059dbdaa5296)

src/perfglue/heap_profiler.cc

index e35f6b1da2454898a70315d39a4081f80b04a752..dc1954012cfcc187a63b91adfcb7ae4e420f7273 100644 (file)
@@ -79,6 +79,12 @@ bool ceph_heap_profiler_running()
 
 static void get_profile_name(char *profile_name, int profile_name_len)
 {
+#if __GNUC__ && __GNUC__ >= 8
+#pragma GCC diagnostic push
+  // Don't care, it doesn't matter, and we can't do anything about it.
+#pragma GCC diagnostic ignored "-Wformat-truncation"
+#endif
+
   char path[PATH_MAX];
   snprintf(path, sizeof(path), "%s", g_conf->log_file.c_str());
   char *last_slash = rindex(path, '/');
@@ -92,6 +98,9 @@ static void get_profile_name(char *profile_name, int profile_name_len)
     snprintf(profile_name, profile_name_len, "%s/%s.profile",
             path, g_conf->name.to_cstr());
   }
+#if __GNUC__ && __GNUC__ >= 8
+#pragma GCC diagnostic pop
+#endif
 }
 
 void ceph_heap_profiler_start()