<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - -Wpragma-pack fires incorrectly in header with #pragma options align which gets reset in the end"
href="https://bugs.llvm.org/show_bug.cgi?id=36307">36307</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-Wpragma-pack fires incorrectly in header with #pragma options align which gets reset in the end
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>arphaman@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>-Wpragma-pack is a new warning in Clang 6 that warns about #pragma pack and
#pragma options align directives that leak outside their headers.
Clang currently incorrectly emits a warning for the alignment value modified in
a header in the following scenario:
$ cat header.h
#pragma options align=mac68k
struct S { int x; };
#pragma options align=reset
$ cat file.c
#include "header.h"
$ clang file.c
file.c:1:10: warning: the current #pragma pack aligment value is modified in
the included file
[-Wpragma-pack]
#include "header.h"
^
./header.h:1:9: note: previous '#pragma pack' directive that modifies alignment
is here
#pragma options align=mac68k
^
1 warning generated.
We should not emit this warning as header correctly resets the alignment value.
This happens only when "#pragma options align=reset" is the last non-PP token
in the header.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>