summaryrefslogtreecommitdiff
path: root/mysys/lf_alloc-pin.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mysql.com>2008-10-07 18:49:01 +0200
committerSergei Golubchik <serg@mysql.com>2008-10-07 18:49:01 +0200
commit10a2bac7775912e25eeba593dbce055e2b30699b (patch)
treeec3de1c68660cd832018aa6e28b430fec4f96505 /mysys/lf_alloc-pin.c
parentcf4aa88993e5da9057efd5c540cf2b6e6ab3d82b (diff)
downloadmariadb-git-10a2bac7775912e25eeba593dbce055e2b30699b.tar.gz
workaround for gcc 4.1.0 strict-aliasing bug
mysys/lf_alloc-pin.c: workaround for gcc 4.1.0 strict-aliasing bug. and yes, I mean a *bug* - as union (in alloc_free) is a documented way to access type-punned pointers. and it helps in newer gcc, but fails in 4.1.0
Diffstat (limited to 'mysys/lf_alloc-pin.c')
-rw-r--r--mysys/lf_alloc-pin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index 4fae8e37ddb..7c3e3785b68 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -320,7 +320,7 @@ static int match_pins(LF_PINS *el, void *addr)
#define available_stack_size(CUR,END) (long) ((char*)(END) - (char*)(CUR))
#endif
-#define next_node(P, X) (*((uchar **)(((uchar *)(X)) + (P)->free_ptr_offset)))
+#define next_node(P, X) (*((uchar * volatile *)(((uchar *)(X)) + (P)->free_ptr_offset)))
#define anext_node(X) next_node(&allocator->pinbox, (X))
/*