r308441 - Recommit r308327: Add a warning for missing '#pragma pack (pop)'

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 05:26:57 PDT 2017

On Wed, Jul 19, 2017 at 1:30 PM, Alex Lorenz via cfe-commits
<cfe-commits at lists.llvm.org> wrote:
> Author: arphaman
> Date: Wed Jul 19 04:30:41 2017
> New Revision: 308441
> URL: http://llvm.org/viewvc/llvm-project?rev=308441&view=rev
> Log:
> Recommit r308327: Add a warning for missing '#pragma pack (pop)'
> and suspicious uses of '#pragma pack' in included files
> This commit adds a new -Wpragma-pack warning. It warns in the following cases:
> - When a translation unit is missing terminating #pragma pack (pop) directives.
> - When entering an included file if the current alignment value as determined
>   by '#pragma pack' directives is different from the default alignment value.
> - When leaving an included file that changed the state of the current alignment
>   value.
> rdar://10184173
> Differential Revision: https://reviews.llvm.org/D35484

This buildbot is unhappy:

>From the build log:

[ 67%] Building CXX object
In file included from
In file included from
error: non-default #pragma pack value might change the alignment of
struct or union members in the included file [-Werror,-Wpragma-pack]
#include "llvm/ProfileData/InstrProfData.inc"
note: previous '#pragma pack' directive that modifies alignment is
note: expanded from macro 'LLVM_PACKED_START'
# define LLVM_PACKED_START _Pragma("pack(push, 1)")
<scratch space>:14:2: note: expanded from here
 pack(push, 1)

More information about the cfe-commits mailing list