> ----- "Marek Vasut" <marek.va...@gmail.com> wrote:
> > Dear Ajay Bhargav,
> > 
> > I compiled the "gplugd" board and I got the following warnings, please
> > fix.
> > 
> > Configuring for gplugd board...
> > armada100_fec.c: In function 'armdfec_init':
> > armada100_fec.c:483:2: warning: dereferencing type-punned pointer will
> > break
> > strict-aliasing rules
> > armada100_fec.c:484:2: warning: dereferencing type-punned pointer will
> > break
> > strict-aliasing rules
> > armada100_fec.c: In function 'armdfec_recv':
> > armada100_fec.c:670:2: warning: dereferencing type-punned pointer will
> > break
> > strict-aliasing rules
> > gplugd.c: In function 'board_init':
> > gplugd.c:95:27: error: 'MACH_TYPE_SHEEVAD' undeclared (first use in
> > this
> > function)
> > gplugd.c:95:27: note: each undeclared identifier is reported only once
> > for each
> > function it appears in
> > 
> > Cheers
> 
> Hi Marek,
> 
> May I know what version of gcc are you using?

ELDK4.2 and ELDK5.0

so gcc4.2 and 4.6, but I include you a testcase (edit path to armada100_fec.h).

gcc -m32 -Wall -fstrict-aliasing -o test2 test2.c ; ./test2

> 
> I will fix the MACH_TYPE_SHEEVAD as suggested by Albert.
> 
> Regards,
> Ajay Bhargav
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;

#include "U-Boot/u-boot-demo/drivers/net/armada100_fec.h"

#define writel(v,a)                (*(volatile unsigned int *)(a) = (v))

int main()
{
	struct armdfec_reg r __attribute__((aligned(128)));
	memset(&r, 0, sizeof(r));
	struct armdfec_reg *fec = (struct armdfec_reg *)&r;
	writel(0xff, &fec->rxfdp[0]);
	printf("%x\n", (u32)fec->rxfdp[0]);

	return 0;
}
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to