From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by mx.groups.io with SMTP id smtpd.web11.19002.1675957530355228235 for ; Thu, 09 Feb 2023 07:45:30 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MvdgpeIz; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 205.220.180.131, mailfrom: quic_rcran@quicinc.com) Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 319EBaDW031973; Thu, 9 Feb 2023 15:45:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=97tsjnKSKtrfJD8Uqui7Rpe7+p1NPBsL+sOmAcGVrQc=; b=MvdgpeIzfpN1UOgLojy781UB6ZjS8mhY2OuW6H/xY3R42vg6dWcWf3xfKvOeVOuu40Tt MbipNnFZQ7AYytSjrLTfpalRv+IwybfHPysQRtABdXEyjiRnWNJK3d36tcwO6DlQKkxJ uIfA8oNIhmFSsjV3TQ6OyXSitIAzMq8Q/Yta0qR9HvH7fZ3SHxJ5ahwUdQh5crW0KKqV M046WUqNH3FfpsLZmXI5Wd8MhfrsL01WGAJFYzJeewis4QhpLM/liX0NVL4wp5fYWFm5 HuQsorJlw84krpHeCv0BLJ7I9T+geJmR4Dyz5UD43Wc83f2GvFsyZ0zicHHNGaj/sr0t sQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nmpte1sa6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Feb 2023 15:45:21 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 319FjKSN016421 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 9 Feb 2023 15:45:20 GMT Received: from linbox.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Thu, 9 Feb 2023 07:45:19 -0800 From: "Rebecca Cran" To: , Michael D Kinney , Liming Gao , Zhiguang Liu CC: Rebecca Cran Subject: [PATCH 1/2] MdePkg: Update Base.h to be compliant with C11 Date: Thu, 9 Feb 2023 08:45:06 -0700 Message-ID: <20230209154507.81877-1-rebecca@quicinc.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: WJAE97PsLsUHX7LBwtfB_D-NYZE4X4tW X-Proofpoint-ORIG-GUID: WJAE97PsLsUHX7LBwtfB_D-NYZE4X4tW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-09_11,2023-02-09_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 mlxlogscore=912 malwarescore=0 spamscore=0 adultscore=0 impostorscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302090148 Content-Transfer-Encoding: 8bit Content-Type: text/plain With the introduction of the use of _Static_assert, edk2 requires a C11 compatible compiler. Update Include/Base.h to be compliant with C11. As of C11, the maximum type of an enum is type `int`. Since the UEFI Specification 2.3.1 Errata C allows either `int` or `unsigned int`, fix the 32-bit enum check to use a signed int. Since the UEFI 2.3 Specification only allowed signed int, update the comment to reference 2.3.1 Errata C where the change was made to allow unsigned int. Signed-off-by: Rebecca Cran --- MdePkg/Include/Base.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index d209e6de280a..e89c84962ab2 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -796,9 +796,9 @@ STATIC_ASSERT (sizeof (L"A") == 4, "sizeof (L\"A\") does not meet UEFI Specif // // The following three enum types are used to verify that the compiler // configuration for enum types is compliant with Section 2.3.1 of the -// UEFI 2.3 Specification. These enum types and enum values are not -// intended to be used. A prefix of '__' is used avoid conflicts with -// other types. +// UEFI 2.3.1 Errata C Specification. These enum types and enum values +// are not intended to be used. A prefix of '__' is used avoid +// conflicts with other types. // typedef enum { __VerifyUint8EnumValue = 0xff @@ -809,12 +809,12 @@ typedef enum { } __VERIFY_UINT16_ENUM_SIZE; typedef enum { - __VerifyUint32EnumValue = 0xffffffff -} __VERIFY_UINT32_ENUM_SIZE; + __VerifyInt32EnumValue = 0x7fffffff +} __VERIFY_INT32_ENUM_SIZE; STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements"); STATIC_ASSERT (sizeof (__VERIFY_UINT16_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements"); -STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements"); +STATIC_ASSERT (sizeof (__VERIFY_INT32_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements"); /** Macro that returns a pointer to the data structure that contains a specified field of -- 2.30.2