From: Pete Batard <pete@akeo.ie>
To: edk2-devel@lists.01.org
Cc: liming.gao@intel.com
Subject: [PATCH 1/6] MdePkg: Disable some Level 4 warnings for VS2017/ARM
Date: Mon, 4 Dec 2017 13:12:00 +0000 [thread overview]
Message-ID: <20171204131205.11304-2-pete@akeo.ie> (raw)
In-Reply-To: <20171204131205.11304-1-pete@akeo.ie>
Warnings 4018, 4100, 4101, 4127, 4214, 4244, 4456, 4701 and 4703 are
disabled as they were found to occur more than 5 times during QEMU
firmware compilation.
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 <pete@akeo.ie>
---
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..00de80bafe0a 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.<BR>
+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
- 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 'signed/unsigned mismatch' warnings.
//
-#ifdef __ARMCC_VERSION
+#pragma warning ( disable : 4018 )
+
+//
+// Disable 'unreferenced formal parameter' warnings.
+//
+#pragma warning ( disable : 4100 )
+
+//
+// Disable 'unreferenced local variable' warnings.
+//
+#pragma warning ( disable : 4101 )
+
+//
+// Suppress warnings for ASSERT(FALSE) or while(TRUE).
+//
+#pragma warning ( disable : 4127 )
+
+//
+// Disable bitfield type check warnings.
+//
+#pragma warning ( disable : 4214 )
+
+//
+// Disable 'conversion from X to Y, possible loss of data' warnings
+//
+#pragma warning ( disable : 4244 )
+
+//
+// Disable 'declaration of X hides previous local declaration' warnings
+//
+#pragma warning ( disable : 4456 )
+
+//
+// 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
next prev parent reply other threads:[~2017-12-04 13:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-04 13:11 [PATCH 0/6] Add ARM support for VS2017 Pete Batard
2017-12-04 13:12 ` Pete Batard [this message]
2017-12-04 15:36 ` [PATCH 1/6] MdePkg: Disable some Level 4 warnings for VS2017/ARM Gao, Liming
2017-12-04 17:42 ` Pete Batard
2017-12-04 13:12 ` [PATCH 2/6] MdePkg/Library/BaseStackCheckLib: Add Null handler " Pete Batard
2017-12-04 13:12 ` [PATCH 3/6] MdePkg/Library/BaseLib: Enable VS2017/ARM builds Pete Batard
2017-12-04 15:40 ` Gao, Liming
2017-12-04 17:43 ` Pete Batard
2017-12-04 13:12 ` [PATCH 4/6] ArmPkg/Library/CompilerIntrinsicsLib: " Pete Batard
2017-12-04 13:12 ` [PATCH 5/6] MdePkg/Include: Add VA list support for VS2017/ARM Pete Batard
2017-12-04 13:12 ` [PATCH 6/6] BaseTools/Conf: Add VS2017/ARM support Pete Batard
2017-12-04 15:48 ` Gao, Liming
2017-12-04 17:43 ` Pete Batard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171204131205.11304-2-pete@akeo.ie \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox