[U-Boot-Users] MPC8610HPCD build warnings

To whom it may concern...
...the MPC8610HPCD board is throwing a couple of warnings for net.c - note that this is the only (PowerPC) board that does this, so it seems to be some special feature of this board:
Configuring for MPC8610HPCD board... net.c: In function 'PingHandler': net.c:770: warning: passing argument 1 of 'NetReadIP' discards qualifiers from pointer target type net.c: In function 'NetSetIP': net.c:1694: warning: passing argument 1 of 'NetCopyIP' discards qualifiers from pointer target type net.c:1695: warning: passing argument 1 of 'NetCopyIP' discards qualifiers from pointer target type net.c: In function 'PingSend': net.c:736: warning: passing argument 1 of 'NetCopyIP' discards qualifiers from pointer target type net.c:737: warning: passing argument 1 of 'NetCopyIP' discards qualifiers from pointer target type
Unfortunately the board is not even listed in the MAINTAINERS file, so I don't know who should take care of this...
Best regards,
Wolfgang Denk

MPC8610HPCD board adds -O2 gcc option to PLATFORM_CPPFLAGS causing overriding default -Os option. New gcc (ver. 4.2.2) produces warnings while compiling net/net.c file with -O2 option. The patch is an attempt to fix this.
Signed-off-by: Anatolij Gustschin agust@denx.de --- include/net.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/net.h b/include/net.h index f6decdc..9a2f03f 100644 --- a/include/net.h +++ b/include/net.h @@ -412,10 +412,10 @@ extern void print_IPaddr (IPaddr_t); * footprint in our tests. */ /* return IP *in network byteorder* */ -static inline IPaddr_t NetReadIP(void *from) +static inline IPaddr_t NetReadIP(volatile void *from) { IPaddr_t ip; - memcpy((void*)&ip, from, sizeof(ip)); + memcpy((void*)&ip, (void*)from, sizeof(ip)); return ip; }
@@ -434,9 +434,9 @@ static inline void NetWriteIP(void *to, IPaddr_t ip) }
/* copy IP */ -static inline void NetCopyIP(void *to, void *from) +static inline void NetCopyIP(volatile void *to, void *from) { - memcpy(to, from, sizeof(IPaddr_t)); + memcpy((void*)to, from, sizeof(IPaddr_t)); }
/* copy ulong */

On Apr 30, 2008, at 6:34 AM, Anatolij Gustschin wrote:
MPC8610HPCD board adds -O2 gcc option to PLATFORM_CPPFLAGS causing overriding default -Os option. New gcc (ver. 4.2.2) produces warnings while compiling net/net.c file with -O2 option. The patch is an attempt to fix this.
nothing against this patch, but should we change MPC8610HPCD to use - Os like everyone else?
- k

Kumar Gala wrote:
On Apr 30, 2008, at 6:34 AM, Anatolij Gustschin wrote:
MPC8610HPCD board adds -O2 gcc option to PLATFORM_CPPFLAGS causing overriding default -Os option. New gcc (ver. 4.2.2) produces warnings while compiling net/net.c file with -O2 option. The patch is an attempt to fix this.
nothing against this patch, but should we change MPC8610HPCD to use -Os like everyone else?
if there is no special reason for using -O2 with MPC8610HPCD, then it should be changed to use -Os.
Anatolij

Kumar Gala wrote:
nothing against this patch, but should we change MPC8610HPCD to use - Os like everyone else?
Beats me. git-blame points to Jon, so he'll have to tell you where the original config.mk came from.
I dropped the -O2 and it still builds fine, but we don't have any 8610's currently to test it on.

Timur Tabi wrote:
Kumar Gala wrote:
nothing against this patch, but should we change MPC8610HPCD to use - Os like everyone else?
Beats me. git-blame points to Jon, so he'll have to tell you where the original config.mk came from.
Bah. There is, let's see.... exactly one commit for that file:
% git log board/freescale/mpc8610hpcd/config.mk commit 3dd2db53ceb0dff80f25c2a07f83f29b907b403e Author: Jon Loeliger jdl@freescale.com Date: Tue Oct 16 13:54:01 2007 -0500
Initial mpc8610hpcd board files.
Signed-off-by: Ed Swarthout Ed.Swarthout@freescale.com Signed-off-by: Mahesh Jade mahesh.jade@freescale.com Signed-off-by: Jason Jin Jason.jin@freescale.com Signed-off-by: Jon Loeliger jdl@freescale.com
So, I'm guessing, it came from the Ed. That is, it came that way from the Day One. So there.
jdl

Jon Loeliger wrote:
So, I'm guessing, it came from the Ed. That is, it came that way from the Day One. So there.
I just tested it without -O2, and it works fine. So the -O2 should be removed.

On Wed, Apr 30, 2008 at 01:34:40PM +0200, Anatolij Gustschin wrote:
diff --git a/include/net.h b/include/net.h index f6decdc..9a2f03f 100644 --- a/include/net.h +++ b/include/net.h @@ -412,10 +412,10 @@ extern void print_IPaddr (IPaddr_t);
- footprint in our tests.
*/ /* return IP *in network byteorder* */ -static inline IPaddr_t NetReadIP(void *from) +static inline IPaddr_t NetReadIP(volatile void *from) { IPaddr_t ip;
- memcpy((void*)&ip, from, sizeof(ip));
- memcpy((void*)&ip, (void*)from, sizeof(ip)); return ip;
}
Maybe we should remove the volatile from the callers instead?
-Scott

In message 1209555280-23311-1-git-send-email-agust@denx.de you wrote:
MPC8610HPCD board adds -O2 gcc option to PLATFORM_CPPFLAGS causing overriding default -Os option. New gcc (ver. 4.2.2) produces warnings while compiling net/net.c file with -O2 option. The patch is an attempt to fix this.
Signed-off-by: Anatolij Gustschin agust@denx.de
include/net.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
participants (6)
-
Anatolij Gustschin
-
Jon Loeliger
-
Kumar Gala
-
Scott Wood
-
Timur Tabi
-
Wolfgang Denk