[pacman-dev] [PATCH v2] alpm: Fix possible alignment issues w/ events

Olivier Brunel jjk at jjacky.com
Tue Jan 5 17:01:07 UTC 2016


On Mon, 4 Jan 2016 04:58:24 -0500
Andrew Gregory <andrew.gregory.8 at gmail.com> wrote:

> On 01/02/16 at 10:14pm, Olivier Brunel wrote:
> > As reported by Rikard Falkeborn[1] using event-specific struct and
> > then typecasting to the generic alpm_event_t could possibly lead to
> > alignment issue, so we now always use alpm_event_t instead.
> > 
> > [1]
> > https://lists.archlinux.org/pipermail/pacman-dev/2015-December/020709.html
> > 
> > Signed-off-by: Olivier Brunel <jjk at jjacky.com>
> > ---
> > Now always using the union member, to avoid initializer warnings
> > (thanks Rikard) and better consistency. Hopefully this time it's
> > all good.
> > 
> >  lib/libalpm/add.c     | 44
> > ++++++++++++++++++++++---------------------- lib/libalpm/be_sync.c
> > |  6 +++--- lib/libalpm/handle.h  |  2 +-
> >  lib/libalpm/hook.c    | 22 +++++++++++-----------
> >  lib/libalpm/remove.c  | 28 ++++++++++++++--------------
> >  lib/libalpm/sync.c    | 14 +++++++-------
> >  lib/libalpm/trans.c   |  2 +-
> >  lib/libalpm/util.c    |  6 +++---
> >  8 files changed, 62 insertions(+), 62 deletions(-)  
> 
> Is there any reason not to just silence the warning by casting the
> event to (void*)?
> 
> apg

hmm... I guess not. If that does silence the warning it would be a
simpler "fix" indeed. Again I don't have clang so I can't test, but it
should be enough indeed, so just changing the typecast in EVENT()
should do it -- I assume a patch isn't needed then?

-j


More information about the pacman-dev mailing list