This patch avoids that the following warning appears when building
with gcc 8 and W=1:

./include/trace/events/wbt.h:36:3: warning: 'strncpy' specified bound 32 equals 
destination size [-Wstringop-truncation]

Signed-off-by: Bart Van Assche <[email protected]>
---
 include/trace/events/wbt.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/trace/events/wbt.h b/include/trace/events/wbt.h
index b048694070e2..29ec58adfddd 100644
--- a/include/trace/events/wbt.h
+++ b/include/trace/events/wbt.h
@@ -8,6 +8,9 @@
 #include <linux/tracepoint.h>
 #include "../../../block/blk-wbt.h"
 
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
+
 /**
  * wbt_stat - trace stats for blk_wb
  * @stat: array of read/write stats
@@ -148,6 +151,8 @@ TRACE_EVENT(wbt_timer,
                  __entry->status, __entry->step, __entry->inflight)
 );
 
+#pragma GCC diagnostic pop
+
 #endif /* _TRACE_WBT_H */
 
 /* This part must be outside protection */
-- 
2.17.1

Reply via email to