From 10a2bac7775912e25eeba593dbce055e2b30699b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 7 Oct 2008 18:49:01 +0200 Subject: 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 --- mysys/lf_alloc-pin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysys/lf_alloc-pin.c') 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)) /* -- cgit v1.2.1