Make smartmontools 6.6 compile with clang 6.0.0 and higher

Because clang 6.0.0 and higher default to -std=gnu++14, like gcc 6 and
higher, compiling smartmontools results in the following error:

os_freebsd.cpp:487:45: error: invalid suffix on literal; C++11 requires
a space between literal and identifier [-Wreserved-user-defined-literal]
  else if (sscanf(dev, NVME_CTRLR_PREFIX"%d"NVME_NS_PREFIX"%d%c",
                                            ^

Fix this by adding spaces around the NVME_NS_PREFIX macro. This makes
the source C++14 compatible.

Approved by:	samm@os2.kiev.ua (maintainer)
PR:		224826
MFH:		2018Q1
This commit is contained in:
Dimitry Andric 2018-01-01 21:19:33 +00:00
parent 7eda167e3a
commit 494c3f8e3e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=457814
2 changed files with 12 additions and 0 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= smartmontools
PORTVERSION= 6.6
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= SF

View File

@ -0,0 +1,11 @@
--- os_freebsd.cpp.orig 2017-04-24 16:34:16 UTC
+++ os_freebsd.cpp
@@ -484,7 +484,7 @@ bool freebsd_nvme_device::open()
}
nsid = 0xFFFFFFFF; // broadcast id
}
- else if (sscanf(dev, NVME_CTRLR_PREFIX"%d"NVME_NS_PREFIX"%d%c",
+ else if (sscanf(dev, NVME_CTRLR_PREFIX"%d" NVME_NS_PREFIX "%d%c",
&ctrlid, &nsid, &tmp) == 2)
{
if(ctrlid < 0 || nsid < 0) {