[PATCH] D20561: Warn when taking address of packed member

Joerg Sonnenberger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 1 13:30:28 PST 2017


joerg added a comment.

The last review left out the case of naturally aligned packed members, IIRC. I have to go over the warning list in NetBSD again, but I'm moderately sure it is not fixed.

The better example is:

  struct __attribute__((__packed__)) bar {
      uint16_t x1;
      uint16_t x2;
  };
  
  &bar->x2;

...which is not aligned.


Repository:
  rL LLVM

https://reviews.llvm.org/D20561





More information about the cfe-commits mailing list