From 6d345cde85e1c6d314d30d7ff29110ac645c4693 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 10 Jul 2018 04:13:21 +0000 Subject: [PATCH] scst_vdisk: Suppress a gcc 8 warning about an intentional string truncation git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7408 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 224f5159e..1196554b1 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -4138,7 +4138,10 @@ static int vdisk_usn_vpd(uint8_t *buf, struct scst_cmd *cmd, read_lock(&vdisk_serial_rwlock); usn_len = strlen(virt_dev->usn); buf[3] = usn_len; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-truncation" strncpy(&buf[4], virt_dev->usn, usn_len); +#pragma GCC diagnostic pop read_unlock(&vdisk_serial_rwlock); } return buf[3] + 4;