Commit 1ba91ba2 authored by Joakim Tjernlund's avatar Joakim Tjernlund Committed by Wolfgang Denk
Browse files

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: default avatarJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
parent d1e0b10a
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment