All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] dlmalloc: remove manual reloc alias warning
@ 2012-08-13  9:02 Andreas Bießmann
  2012-08-13 14:54 ` Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Andreas Bießmann @ 2012-08-13  9:02 UTC (permalink / raw)
  To: u-boot

From: Andreas Bie?mann <biessmann@corscience.de>

The avr32 architecture (and some others) require manual relocation. Due to the
previous error all avr32 boards gave warnings in MAKEALL wich makes it hard to
find new warnings.

This patch fixes following warning:
---8<---
dlmalloc.c: In function 'malloc_bin_reloc':
dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules
dlmalloc.c:1493: warning: dereferencing pointer 'p' does break strict-aliasing rules
dlmalloc.c:1490: note: initialized from here
dlmalloc.c:1493: note: initialized from here
--->8---

Signed-off-by: Andreas Bie?mann <biessmann@corscience.de>
---
A question to all the other related arches, namely m68k, mips, nds32 and
sparc: Do you encounter the same warnings or is this warning due to my
outdated compiler (4.4.3 currently, unfortunately atmel do not bother to send
their patches mainline)?

 common/dlmalloc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index c645d73..78b1885 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -1485,9 +1485,10 @@ static mbinptr av_[NAV * 2 + 2] = {
 };
 
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
+typedef unsigned long __attribute__((__may_alias__)) ulong_aliased;
 void malloc_bin_reloc (void)
 {
-	unsigned long *p = (unsigned long *)(&av_[2]);
+	ulong_aliased *p = (ulong_aliased *)(&av_[2]);
 	int i;
 	for (i=2; i<(sizeof(av_)/sizeof(mbinptr)); ++i) {
 		*p++ += gd->reloc_off;
-- 
1.7.10.4

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

end of thread, other threads:[~2012-09-01 13:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-13  9:02 [U-Boot] [PATCH] dlmalloc: remove manual reloc alias warning Andreas Bießmann
2012-08-13 14:54 ` Mike Frysinger
2012-08-13 15:14   ` Andreas Bießmann
2012-08-13 15:31     ` Andreas Bießmann
2012-08-14  8:50 ` Andreas Bießmann
2012-08-15  0:15   ` Simon Glass
2012-08-15  6:29     ` Andreas Bießmann
2012-09-01 10:10 ` Wolfgang Denk
2012-09-01 12:02   ` Wolfgang Denk
2012-09-01 13:20     ` Andreas Bießmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.