diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-12-23 18:28:44 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-12-23 18:29:13 -0800 |
commit | e2767bd010d5c30df97789b8b56a42eff4234e5b (patch) | |
tree | 342bd4317719b9f336a31a94f218f4cfb0d6f1a6 /src/thread.c | |
parent | eff901b8a39f42ddedf4c1db833b9071cae5962f (diff) | |
download | emacs-e2767bd010d5c30df97789b8b56a42eff4234e5b.tar.gz emacs-e2767bd010d5c30df97789b8b56a42eff4234e5b.tar.bz2 emacs-e2767bd010d5c30df97789b8b56a42eff4234e5b.zip |
Use max_align_t instead of void *
* src/thread.c (run_thread): Don’t assume void * is aligned enough.
Diffstat (limited to 'src/thread.c')
-rw-r--r-- | src/thread.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/thread.c b/src/thread.c index 3f9595274e9..0bb0b7e006a 100644 --- a/src/thread.c +++ b/src/thread.c @@ -645,17 +645,12 @@ run_thread (void *state) { /* Make sure stack_top and m_stack_bottom are properly aligned as GC expects. */ - union - { - void *p; - char c; - } stack_pos; + max_align_t stack_pos; struct thread_state *self = state; struct thread_state **iter; - self->m_stack_bottom = &stack_pos.c; - self->stack_top = &stack_pos.c; + self->m_stack_bottom = self->stack_top = (char *) &stack_pos; self->thread_id = sys_thread_self (); acquire_global_lock (self); |