diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 340d6d109..ecd1f13d4 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -4141,12 +4141,14 @@ 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 #if __GNUC__ -0 >= 8 +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstringop-truncation" #endif strncpy(&buf[4], virt_dev->usn, usn_len); +#if __GNUC__ -0 >= 8 #pragma GCC diagnostic pop +#endif read_unlock(&vdisk_serial_rwlock); } return buf[3] + 4;