public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Warning in omap3_mmc.c
@ 2009-09-06  7:55 Dirk Behme
  2009-09-06 13:17 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 2+ messages in thread
From: Dirk Behme @ 2009-09-06  7:55 UTC (permalink / raw)
  To: u-boot


Recent U-Boot head gives (e.g. for omap3_beagle_config)

omap3_mmc.c: In function 'mmc_detect_card': 

omap3_mmc.c:279: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
omap3_mmc.c:292: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
omap3_mmc.c:336: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
omap3_mmc.c: In function 'configure_mmc': 

omap3_mmc.c:460: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
omap3_mmc.c:461: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
omap3_mmc.c:462: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
omap3_mmc.c:463: warning: dereferencing type-punned pointer will break 
strict-aliasing rules

This is from e.g.

279: ocr_recvd = ((mmc_resp_r3 *) resp)->ocr;
336: mmc_card_cur->RCA = ((mmc_resp_r6 *) resp)->newpublishedrca;

with

unsigned int resp[4];

and

typedef struct {
	unsigned int ocr;
} mmc_resp_r3;

typedef struct {
	unsigned short cardstatus;
	unsigned short newpublishedrca;
} mmc_resp_r6;

Any idea how to fix this?

Many thanks

Dirk

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot] Warning in omap3_mmc.c
  2009-09-06  7:55 [U-Boot] Warning in omap3_mmc.c Dirk Behme
@ 2009-09-06 13:17 ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-09-06 13:17 UTC (permalink / raw)
  To: u-boot

On 09:55 Sun 06 Sep     , Dirk Behme wrote:
> 
> Recent U-Boot head gives (e.g. for omap3_beagle_config)
> 
> omap3_mmc.c: In function 'mmc_detect_card': 
> 
> omap3_mmc.c:279: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> omap3_mmc.c:292: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> omap3_mmc.c:336: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> omap3_mmc.c: In function 'configure_mmc': 
> 
> omap3_mmc.c:460: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> omap3_mmc.c:461: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> omap3_mmc.c:462: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> omap3_mmc.c:463: warning: dereferencing type-punned pointer will break 
> strict-aliasing rules
> 
> This is from e.g.
> 
> 279: ocr_recvd = ((mmc_resp_r3 *) resp)->ocr;
> 336: mmc_card_cur->RCA = ((mmc_resp_r6 *) resp)->newpublishedrca;
> 
> with
> 
> unsigned int resp[4];
> 
> and
> 
> typedef struct {
> 	unsigned int ocr;
> } mmc_resp_r3;
> 
> typedef struct {
> 	unsigned short cardstatus;
> 	unsigned short newpublishedrca;
> } mmc_resp_r6;
> 
> Any idea how to fix this?
try to create a union

Best Regards,
J.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-06 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-06  7:55 [U-Boot] Warning in omap3_mmc.c Dirk Behme
2009-09-06 13:17 ` Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox