diff options
author | stijn <stinos@zoho.com> | 2014-06-19 13:53:15 +0200 |
---|---|---|
committer | stijn <stinos@zoho.com> | 2014-06-22 11:32:32 +0200 |
commit | de5ce6d4613093f06de34746e865b32bcc243dd9 (patch) | |
tree | bf434e41997f98fb2f1a4d56f2949864d86307ea /unix | |
parent | 8abcf666cb638152634790a882875f52f7f0432b (diff) | |
download | micropython-de5ce6d4613093f06de34746e865b32bcc243dd9.tar.gz micropython-de5ce6d4613093f06de34746e865b32bcc243dd9.zip |
gc: Use simple cast instead of union to silence compiler
Diffstat (limited to 'unix')
-rw-r--r-- | unix/gccollect.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/unix/gccollect.c b/unix/gccollect.c index 792913821f..f24cc52495 100644 --- a/unix/gccollect.c +++ b/unix/gccollect.c @@ -144,15 +144,7 @@ void gc_collect(void) { regs_t regs; gc_helper_get_regs(regs); // GC stack (and regs because we captured them) -#ifdef __MINGW32__ - // The Mingw cross-compiler on Travis complains - // 'warning: dereferencing type-punned pointer will break strict-aliasing rules' - // when casting ®s to void** directly so use a union. - union { regs_t *r; void **ptr; } cast_regs = { ®s }; - void **regs_ptr = cast_regs.ptr; -#else - void **regs_ptr = (void**)®s; -#endif + void **regs_ptr = (void**)(void*)®s; gc_collect_root(regs_ptr, ((machine_uint_t)stack_top - (machine_uint_t)®s) / sizeof(machine_uint_t)); gc_collect_end(); |