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
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A wise person makes his own decisions, a weak one obeys public opinion. -- Chinese proverb
PATCH 1/1 Fix warnings while compiling net/net.c for MPC8610HPCD board
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.
--- include/net.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
include/net.h +4 -4
@@ -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 */
Signature · 1 line
1.5.3.3
PATCH 1/1 Fix warnings while compiling net/net.c for MPC8610HPCD board
Quoted 4 lines · Anatolij Gustschin
MPC8610HPCD board adds -O2 gcc option to
PLATFORM_CPPFLAGScausing overriding default -Os option. New gcc (ver. 4.2.2) produces warnings while compilingnet/net.cfile 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
PATCH 1/1 Fix warnings while compiling net/net.c for MPC8610HPCD board
Quoted 9 lines · Kumar Gala
Quoted 4 lines · Anatolij Gustschin
MPC8610HPCD board adds -O2 gcc option to
PLATFORM_CPPFLAGScausing overriding default -Os option. New gcc (ver. 4.2.2) produces warnings while compilingnet/net.cfile 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
PATCH 1/1 Fix warnings while compiling net/net.c for MPC8610HPCD board
In reply to Kumar GalaQuoted 2 lines · Kumar Gala
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.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 Fix warnings while compiling net/net.c for MPC8610HPCD board
Quoted 7 lines · Timur Tabi
Quoted 2 lines · Kumar Gala
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 <[email protected]>
Date: Tue Oct 16 13:54:01 2007 -0500
Initial mpc8610hpcd board files.
So, I'm guessing, it came from the Ed. That is, it came that way from the Day One. So there.
jdl
PATCH 1/1 Fix warnings while compiling net/net.c for MPC8610HPCD board
Quoted 2 lines · Jon Loeliger
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.
Signature · 2 lines
Timur Tabi Linux kernel developer at Freescale
PATCH 1/1 Fix warnings while compiling net/net.c for MPC8610HPCD board
In reply to Anatolij GustschinQuoted 7 lines · Anatolij Gustschin
include/net.h +0
-0@@ -412,10 +412,10 @@ extern void print_IPaddr (IPaddr_t);* footprint in our tests. */
include/net.h extern void print_IPaddr (IPaddr_t); · line 421
Quoted 10 lines
include/net.h +2
-2/* 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
Wolfgang Denk
AppliedPATCH 1/1 Fix warnings while compiling net/net.c for MPC8610HPCD board
In reply to Anatolij GustschinQuoted 9 lines · In message <[email protected]> you wrote:
MPC8610HPCD board adds -O2 gcc option to
PLATFORM_CPPFLAGScausing overriding default -Os option. New gcc (ver. 4.2.2) produces warnings while compilingnet/net.cfile with -O2 option. The patch is an attempt to fix this.Signed-off-by Anatolij Gustschin <[email protected]>--- include/net.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de ######## This message was made from 100% recycled electrons. ########