[PATCH] D35484: Add a warning for missing '#pragma pack (pop)' and suspicious '#pragma pack' uses when including files
Alex Lorenz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 19 06:01:58 PDT 2017
arphaman added a comment.
This triggered a warning in LLVM itself, in CoverageMapping.h :
error: non-default #pragma pack value might change the alignment of
struct or union members in the included file [-Werror,-Wpragma-pack]
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
I think I might tweak this diagnostic to avoid warning in that case. It might be better to just avoid warning about "non-default #pragma pack value might change the alignment of
struct or union members in the included file" until a first record declaration is encountered in the included file. This will avoid the warning in LLVM as the packed class is declared in the file that includes the header.
More information about the cfe-commits