[edk2,edk2-staging,02/20] IntelUndiPkg/XGigUndiDxe: move MSFT warning overrides to INF file

Message ID 20181115023353.20159-3-ard.biesheuvel@linaro.org
State New
Headers show
Series
  • IntelUndiPkg/XGigUndiDxe: fix GCC / ARM build issues
Related show

Commit Message

Ard Biesheuvel Nov. 15, 2018, 2:33 a.m.
GCC chokes on the unknown MSVC specific #pragmas used for suppressing
warnings, so remove them and use the INF BuildOptions section instead.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf |  4 ++--
 IntelUndiPkg/XGigUndiDxe/ixgbe_osdep.h   | 10 ----------
 2 files changed, 2 insertions(+), 12 deletions(-)

-- 
2.17.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Ryszard Knop Jan. 30, 2019, 3:44 p.m. | #1
Reviewed-by: Ryszard Knop <ryszard.knop@linux.intel.com>


On Wed, 2018-11-14 at 18:33 -0800, ard.biesheuvela wrote:
> GCC chokes on the unknown MSVC specific #pragmas used for suppressing

> warnings, so remove them and use the INF BuildOptions section

> instead.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>

> ---

>  IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf |  4 ++--

>  IntelUndiPkg/XGigUndiDxe/ixgbe_osdep.h   | 10 ----------

>  2 files changed, 2 insertions(+), 12 deletions(-)

> 

> diff --git a/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf

> b/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf

> index ab9c64dac7e8..7ccc52bc9869 100644

> --- a/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf

> +++ b/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf

> @@ -44,7 +44,7 @@ UNLOAD_IMAGE         = UnloadXGigUndiDriver

>  

>  [BuildOptions.common]

>  

> -MSFT:*_*_*_CC_FLAGS = /FAcs /D MDEPKG_NDEBUG /D UNDI_10G

> +MSFT:*_*_*_CC_FLAGS = /FAcs /D MDEPKG_NDEBUG /D UNDI_10G /wd4244

> /wd4206 /wd4189

>  GCC:*_*_*_CC_FLAGS = -DUNDI_10G

>  GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG

>  

> @@ -60,7 +60,7 @@ GCC:*_*_*_CC_FLAGS = -DEFI64

>  

>  [BuildOptions.IA32]

>  

> -MSFT:*_*_*_CC_FLAGS = /D EFI32

> +MSFT:*_*_*_CC_FLAGS = /D EFI32 /wd4305

>  GCC:*_*_*_CC_FLAGS = -DEFI32

>  

>  [sources.common]

> diff --git a/IntelUndiPkg/XGigUndiDxe/ixgbe_osdep.h

> b/IntelUndiPkg/XGigUndiDxe/ixgbe_osdep.h

> index 6fa0d1605c7c..368f40811904 100644

> --- a/IntelUndiPkg/XGigUndiDxe/ixgbe_osdep.h

> +++ b/IntelUndiPkg/XGigUndiDxe/ixgbe_osdep.h

> @@ -29,16 +29,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE

> POSSIBILITY OF SUCH DAMAGE.

>  #ifndef IXGBE_OSDEP_H_

>  #define IXGBE_OSDEP_H_

>  

> -#pragma warning(disable : 4244)

> -#pragma warning(disable : 4206)

> -#pragma warning(disable : 4189)

> -

> -#ifdef EFI32

> -

> -// Remove truncation warning in type cast when some 64 bit variables

> are converted to 32-bit pointers

> -#pragma warning(disable : 4305)

> -#endif /* EFI32 */

> -

>  #ifndef EFI_SPECIFICATION_VERSION

>  #define EFI_SPECIFICATION_VERSION 0x00020000

>  #endif /* EFI_SPECIFICATION_VERSION */


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Patch

diff --git a/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf b/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
index ab9c64dac7e8..7ccc52bc9869 100644
--- a/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
+++ b/IntelUndiPkg/XGigUndiDxe/XGigUndiDxe.inf
@@ -44,7 +44,7 @@  UNLOAD_IMAGE         = UnloadXGigUndiDriver
 
 [BuildOptions.common]
 
-MSFT:*_*_*_CC_FLAGS = /FAcs /D MDEPKG_NDEBUG /D UNDI_10G
+MSFT:*_*_*_CC_FLAGS = /FAcs /D MDEPKG_NDEBUG /D UNDI_10G /wd4244 /wd4206 /wd4189
 GCC:*_*_*_CC_FLAGS = -DUNDI_10G
 GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
 
@@ -60,7 +60,7 @@  GCC:*_*_*_CC_FLAGS = -DEFI64
 
 [BuildOptions.IA32]
 
-MSFT:*_*_*_CC_FLAGS = /D EFI32
+MSFT:*_*_*_CC_FLAGS = /D EFI32 /wd4305
 GCC:*_*_*_CC_FLAGS = -DEFI32
 
 [sources.common]
diff --git a/IntelUndiPkg/XGigUndiDxe/ixgbe_osdep.h b/IntelUndiPkg/XGigUndiDxe/ixgbe_osdep.h
index 6fa0d1605c7c..368f40811904 100644
--- a/IntelUndiPkg/XGigUndiDxe/ixgbe_osdep.h
+++ b/IntelUndiPkg/XGigUndiDxe/ixgbe_osdep.h
@@ -29,16 +29,6 @@  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #ifndef IXGBE_OSDEP_H_
 #define IXGBE_OSDEP_H_
 
-#pragma warning(disable : 4244)
-#pragma warning(disable : 4206)
-#pragma warning(disable : 4189)
-
-#ifdef EFI32
-
-// Remove truncation warning in type cast when some 64 bit variables are converted to 32-bit pointers
-#pragma warning(disable : 4305)
-#endif /* EFI32 */
-
 #ifndef EFI_SPECIFICATION_VERSION
 #define EFI_SPECIFICATION_VERSION 0x00020000
 #endif /* EFI_SPECIFICATION_VERSION */