From: Adam C. Emerson Date: Tue, 8 May 2018 21:19:38 +0000 (-0400) Subject: perfglue: Silence truncation warning X-Git-Tag: v14.0.0~162^2~12 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a0d15b915f8092f9cfcd19a700e7059dbdaa5296;p=ceph-ci.git perfglue: Silence truncation warning Signed-off-by: Adam C. Emerson --- diff --git a/src/perfglue/heap_profiler.cc b/src/perfglue/heap_profiler.cc index e35f6b1da24..dc1954012cf 100644 --- a/src/perfglue/heap_profiler.cc +++ b/src/perfglue/heap_profiler.cc @@ -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()