From b5de8333c48d17cf783c4f71218c7294fa8f75b7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 14 Jul 2018 14:43:20 +0000 Subject: [PATCH] scst_vdisk: Avoid that gcc 7 and older warn about pragma GCC diagnostic ignored "-Wstringop-truncation" git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7423 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index bb202c65a..5b7fb8b31 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -4142,7 +4142,9 @@ static int vdisk_usn_vpd(uint8_t *buf, struct scst_cmd *cmd, usn_len = strlen(virt_dev->usn); buf[3] = usn_len; #pragma GCC diagnostic push +#if __GNUC__ -0 >= 8 #pragma GCC diagnostic ignored "-Wstringop-truncation" +#endif strncpy(&buf[4], virt_dev->usn, usn_len); #pragma GCC diagnostic pop read_unlock(&vdisk_serial_rwlock);