From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4B8952217CE2F for ; Wed, 6 Dec 2017 03:10:49 -0800 (PST) Received: by mail-wm0-x244.google.com with SMTP id f206so6378132wmf.5 for ; Wed, 06 Dec 2017 03:15:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7FLTjc7q/aV2jLiFcb5mmv/TIY+jnBimvLwTAJbUE+Q=; b=ftN5JZ0E4KCqqrZUSzbo6Wqil6Iv3CnDzpnP2PkbxnIAW/ijUjzESSxFcOLE5qlD85 fRAYLC1Ge7w8CwolrHHCPC7iLA/0Rfp97nQ/aRcfwnBvyirLNXvF20Jy+aBJaaao2b+e M7NELRZQ6ToWnnmFwL47usoYzz4ZBKOx/NNy8RKhVY2XgACuYZcdE7h4FAPq0113vXAK w2U78USWBdxbacicL1AeiBVikPt8XL8L6aBkc+uVVmxsxOtrevFYRxjWg+PkD3premNH Iru65EDRaSLheaEq68AbC8Qx7zfnwZ+DnCxyAQXgc/3Bck6XkZJNyv0ZB1gz5jiSoZHu qGCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7FLTjc7q/aV2jLiFcb5mmv/TIY+jnBimvLwTAJbUE+Q=; b=DUmgdlz598byxQu9NVXJtFrbioEU9mg/3ON9ApmwxiwKG3vhJB5qEsYR8uYAyRztQR ymK2Y1KnH8XVd1ru05CqCt3SnFW/2NjI7CSeXQxywlCWv0oQkNXStnl9w22LhaR2lMyf CW3knmnUYPNhEdMd1ydsuMtG3gufSt6AwILGFmpO7rqiyYt7hRE+KF54zuaxd7bWlnOU sff4pbkLZpf2QYnCijKam0vOLInO2cnP4pRF8fmASWGQgcwP0HRckOZ8uNvpVjC0ftog FC3mtvv+P7gj4XOF+ztIvY0yxeYBfrK1dJsypKoAOsxYBcJJx2NQR1KAtHvTxfjSlHf5 UYzA== X-Gm-Message-State: AJaThX6/ZAoydp436wrVC68p8xjkZD1tFM9/kZ2FMvUBP+4feUqGY4CI v6ZbbPYI95Elx0urhNQT+xR5sfzow4c= X-Google-Smtp-Source: AGs4zMb9trKsUDyKSbzpREMmSRYzdW5x10sY1rL2BR4DtPRCbfX4RfCwfAs7JABT7KdYo8G1mMRmKw== X-Received: by 10.80.141.9 with SMTP id s9mr40765963eds.238.1512558919864; Wed, 06 Dec 2017 03:15:19 -0800 (PST) Received: from localhost.localdomain ([84.203.69.204]) by smtp.gmail.com with ESMTPSA id b17sm1132422edj.21.2017.12.06.03.15.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Dec 2017 03:15:19 -0800 (PST) From: Pete Batard To: edk2-devel@lists.01.org Cc: liming.gao@intel.com Date: Wed, 6 Dec 2017 11:15:04 +0000 Message-Id: <20171206111509.10144-2-pete@akeo.ie> X-Mailer: git-send-email 2.9.3.windows.2 In-Reply-To: <20171206111509.10144-1-pete@akeo.ie> References: <20171206111509.10144-1-pete@akeo.ie> Subject: [PATCH v2 1/6] MdePkg: Disable some Level 4 warnings for VS2017/ARM X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 11:10:50 -0000 We disable the exact same warnings as IA32 and X64. Also create a dummy macro for PRESERVE8, as this is not supported by the Microsoft ARM assembler. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard --- MdePkg/Include/Arm/ProcessorBind.h | 96 +++++++++++++++----- 1 file changed, 75 insertions(+), 21 deletions(-) diff --git a/MdePkg/Include/Arm/ProcessorBind.h b/MdePkg/Include/Arm/ProcessorBind.h index dde1fd1152ba..0700e4a4c50a 100644 --- a/MdePkg/Include/Arm/ProcessorBind.h +++ b/MdePkg/Include/Arm/ProcessorBind.h @@ -1,15 +1,15 @@ /** @file Processor or Compiler specific defines and types for ARM. - Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
- This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ @@ -28,14 +28,63 @@ #pragma pack() #endif +#if defined(_MSC_EXTENSIONS) + // -// RVCT does not support the __builtin_unreachable() macro +// Disable some level 4 compilation warnings (same as IA32 and X64) // -#ifdef __ARMCC_VERSION + +// +// Disabling bitfield type checking warnings. +// +#pragma warning ( disable : 4214 ) + +// +// Disabling the unreferenced formal parameter warnings. +// +#pragma warning ( disable : 4100 ) + +// +// Disable slightly different base types warning as CHAR8 * can not be set +// to a constant string. +// +#pragma warning ( disable : 4057 ) + +// +// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning +// +#pragma warning ( disable : 4127 ) + +// +// This warning is caused by functions defined but not used. For precompiled header only. +// +#pragma warning ( disable : 4505 ) + +// +// This warning is caused by empty (after preprocessing) source file. For precompiled header only. +// +#pragma warning ( disable : 4206 ) + +// +// Disable 'potentially uninitialized local variable X used' warnings +// +#pragma warning ( disable : 4701 ) + +// +// Disable 'potentially uninitialized local pointer variable X used' warnings +// +#pragma warning ( disable : 4703 ) + +#endif + +// +// RVCT and MSFT don't support the __builtin_unreachable() macro +// +#if defined(__ARMCC_VERSION) || defined(_MSC_EXTENSIONS) #define UNREACHABLE() #endif -#if _MSC_EXTENSIONS +#if defined(_MSC_EXTENSIONS) // // use Microsoft* C compiler dependent integer width types // @@ -52,7 +101,7 @@ typedef signed char INT8; #else // - // Assume standard ARM alignment. + // Assume standard ARM alignment. // Need to check portability of long long // typedef unsigned long long UINT64; @@ -121,7 +170,7 @@ typedef INT32 INTN; // use the correct C calling convention. All protocol member functions and // EFI intrinsics are required to modify their member functions with EFIAPI. // -#define EFIAPI +#define EFIAPI // When compiling with Clang, we still use GNU as for the assembler, so we still // need to define the GCC_ASM* macros. @@ -142,34 +191,39 @@ typedef INT32 INTN; #define GCC_ASM_EXPORT(func__) \ .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\ - .type ASM_PFX(func__), %function + .type ASM_PFX(func__), %function #define GCC_ASM_IMPORT(func__) \ .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__) - + #else // - // .type not supported by Apple Xcode tools + // .type not supported by Apple Xcode tools // - #define INTERWORK_FUNC(func__) + #define INTERWORK_FUNC(func__) #define GCC_ASM_EXPORT(func__) \ .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \ - - #define GCC_ASM_IMPORT(name) + + #define GCC_ASM_IMPORT(name) #endif +#elif defined(_MSC_EXTENSIONS) + // + // PRESERVE8 is not supported by the MSFT assembler. + // + #define PRESERVE8 #endif /** Return the pointer to the first instruction of a function given a function pointer. - On ARM CPU architectures, these two pointer values are the same, + On ARM CPU architectures, these two pointer values are the same, so the implementation of this macro is very simple. - + @param FunctionPointer A pointer to a function. @return The pointer to the first instruction of a function given a function pointer. - + **/ #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer) -- 2.9.3.windows.2