Patch 5: Fix compilation warning in imbapr.c

On Mon, Apr 29, 2013 at 9:01 PM, Dan Gora <d...@adax.com> wrote:
> Hi All,
>
> Following are 5 patches to fix the compilation warnings which appear
> in newer gcc versions (gcc 4.7.2 currently only seen in Ububtu 12.10
> AFAIK) when -Wno-unused-return is removed from the compilation flags.
>
> -Wno-unused-return basically _has_ to come out.  A few compilation
> warnings are better than having the compilation just fail with older
> gcc versions.  Hopefully these patches will fix the compilation
> warnings to everyone's satisfaction.
>
> thanks
> dan
From b035bb1f551b1fd42acb995ebf2c2b4aa1fac224 Mon Sep 17 00:00:00 2001
From: Dan Gora <d...@adax.com>
Date: Tue, 2 Apr 2013 17:22:28 -0300
Subject: [PATCH 5/6] Fixed compilation warning in plugins/imb/imbapr.c

NULL should never be cast to an int.
---
 ipmitool/src/plugins/imb/imbapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipmitool/src/plugins/imb/imbapi.c 
b/ipmitool/src/plugins/imb/imbapi.c
index ee5e2d3..61d8a28 100644
--- a/ipmitool/src/plugins/imb/imbapi.c
+++ b/ipmitool/src/plugins/imb/imbapi.c
@@ -1968,7 +1968,7 @@ MapPhysicalMemory(int startAddress,int addressLength, int 
*virtualAddress )
        unsigned int            diff;
        caddr_t                         startvAddress;
 
-       if ((startAddress == (int) NULL) || (addressLength <= 0))
+       if ((startAddress == 0) || (addressLength <= 0))
                return ACCESN_ERROR;
 
        if ( (fd = open("/dev/mem", O_RDONLY)) < 0) {
-- 
1.7.11

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to