diff options
author | Joakim Tjernlund <Joakim.Tjernlund@transmode.se> | 2010-10-14 08:51:34 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-10-18 22:44:31 +0200 |
commit | 1ba91ba23396005ef7b42381cc21f0baf78d0d60 (patch) | |
tree | 9dfb972892fb005aa8aec22fd4a2ad519e32fc1c | |
parent | d1e0b10accdbac2e0a8b2cbf7c589645442f87c5 (diff) | |
download | u-boot-imx-1ba91ba23396005ef7b42381cc21f0baf78d0d60.zip u-boot-imx-1ba91ba23396005ef7b42381cc21f0baf78d0d60.tar.gz u-boot-imx-1ba91ba23396005ef7b42381cc21f0baf78d0d60.tar.bz2 |
dlmalloc.c: Fix gcc alias warning
Fix these warnings:
dlmalloc.c: In function 'free':
dlmalloc.c:2507: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules
dlmalloc.c:2507: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules
dlmalloc.c:2507: warning: dereferencing pointer '({anonymous})' does break strict-aliasing rules
Some page(http://blog.worldofcoding.com/2010/02/solving-gcc-44-strict-aliasing-problems.html)
suggests adding __attribute__((__may_alias__)). Doing so makes the warnings go away.
Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | common/dlmalloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c index ae5702d..fce7a76 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -1152,7 +1152,7 @@ struct malloc_chunk INTERNAL_SIZE_T size; /* Size in bytes, including overhead. */ struct malloc_chunk* fd; /* double links -- used only if free. */ struct malloc_chunk* bk; -}; +} __attribute__((__may_alias__)) ; typedef struct malloc_chunk* mchunkptr; |