From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web11.5524.1611896911546851708 for ; Thu, 28 Jan 2021 21:08:31 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@hpe.com header.s=pps0720 header.b=CerFSCFE; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=06631716d4=abner.chang@hpe.com) Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 10T53utf024077; Fri, 29 Jan 2021 05:08:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=pps0720; bh=2UDf9++waT0P+Pc1c0GiyWOGuB/h0o8jGCUz1iil0qw=; b=CerFSCFEdmMtvFuQAUeN6M7NUiBbqSIppalRUkpdQfsdrSsQFhuhm0TDrWcth6mkmQf0 gUBD5knY/SocKgT9XhYqcSaZF8sn94YSotVlynzj+kgt+q1e0IF/d9Iv5djrzhEIB93n 3YxXpwL1VznNllD3QN230TjWOdxf4Cvv0xuZU38ZQfkR+sw6mq/cjsLJRr+CrlCKpYY5 oFKUj8N284JcuEEcvcKzEp5rt5aD0hlX+By9PPTZ0RJDIGGcuMDESp4FyIJ7rae82lja BhQZLesTGO/4m079yyhwqJ5wE2C4F33hbejPnJ9Gl2/Ssxq04vXrbE+bPTmuzEY7UclF KQ== Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 36b0x82edk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Jan 2021 05:08:30 +0000 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g9t5009.houston.hpe.com (Postfix) with ESMTP id 6497C65; Fri, 29 Jan 2021 05:08:29 +0000 (UTC) Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 33AB14A; Fri, 29 Jan 2021 05:08:27 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Leif Lindholm , Nickle Wang , Michael D Kinney Subject: [PATCH] RedfishPkg/JsonLib: Ignore the build error of assignment within conditional expression Date: Fri, 29 Jan 2021 12:19:42 +0800 Message-Id: <20210129041942.20583-1-abner.chang@hpe.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.343,18.0.737 definitions=2021-01-29_02:2021-01-28,2021-01-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 priorityscore=1501 adultscore=0 bulkscore=0 mlxscore=0 clxscore=1015 suspectscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101290026 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-002e3701.pphosted.com id 10T53utf024077 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Add build option to ignore the build error of "assignment within conditional expression". This build error is caused by the macros defined in open source project jansson header file jansson.h. - json_object_foreach - json_object_foreach_safe - json_array_foreach We use build option to avoid the build errors on Visual Studio (GCC doesn't havvve this problem) for now. Already sent an email to jansson open source community to revise these macro as Leif's suggestion as below, for (key =3D json_object_iter_key(json_object_iter(object)); \ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 key; = \ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 key =3D json_object_iter_key(=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 \ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 json_o= bject_iter_next(object, json_object_key_to_iter(key)))) {=C2=A0\ =C2=A0 value =3D json_object_iter_value(json_object_key_to_iter(key));=C2=A0 =C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0\ if (!value) \ break;=C2=A0\ } \ We will remove this build option once the patch is accepted and upstreamed. Signed-off-by: Abner Chang Cc: Leif Lindholm Cc: Nickle Wang Cc: Michael D Kinney --- RedfishPkg/Library/JsonLib/JsonLib.inf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RedfishPkg/Library/JsonLib/JsonLib.inf b/RedfishPkg/Library/= JsonLib/JsonLib.inf index 48b094a78a..9d52a622e1 100644 --- a/RedfishPkg/Library/JsonLib/JsonLib.inf +++ b/RedfishPkg/Library/JsonLib/JsonLib.inf @@ -75,12 +75,13 @@ # C4244: conversion from type1 to type2, possible loss of data # C4334: 32-bit shift implicitly converted to 64-bit # C4204: nonstandard extension used: non-constant aggregate initiali= zer + # C4706: assignment within conditional expression # # Define macro HAVE_CONFIG_H to include jansson_private_config.h to bu= ild. # Undefined _WIN32, WIN64, _MSC_VER macros # On GCC, no error on the unused-function and unused-but-set-variable. # - MSFT:*_*_X64_CC_FLAGS =3D /wd4204 /wd4244 /wd4090 /wd4334 /DHAVE_CONFI= G_H=3D1 /U_WIN32 /UWIN64 /U_MSC_VER - MSFT:*_*_IA32_CC_FLAGS =3D /wd4204 /wd4244 /wd4090 /DHAVE_CONFIG_H=3D1= /U_WIN32 /UWIN64 /U_MSC_VER + MSFT:*_*_X64_CC_FLAGS =3D /wd4204 /wd4244 /wd4090 /wd4334 /wd4706 /DHA= VE_CONFIG_H=3D1 /U_WIN32 /UWIN64 /U_MSC_VER + MSFT:*_*_IA32_CC_FLAGS =3D /wd4204 /wd4244 /wd4090 /wd4706 /DHAVE_CONF= IG_H=3D1 /U_WIN32 /UWIN64 /U_MSC_VER GCC:*_*_*_CC_FLAGS =3D -Wno-unused-function -Wno-unused-but-set-variab= le =20 --=20 2.17.1