[llvm-bugs] [Bug 30737] New: Half-baked clang warning about address of members of packed structs

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Oct 19 09:57:03 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30737

            Bug ID: 30737
           Summary: Half-baked clang warning about address of members of
                    packed structs
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: stark at mit.edu
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17461
  --> https://llvm.org/bugs/attachment.cgi?id=17461&action=edit
Minimal test case with actual code from production

I'm using clang 4.0 on Debian and getting spurious "address-of-packed-member"
warnings.

The struct in question is declared with 

  __attribute__((packed))
  __attribute__((aligned(2)))

and consists of three unsigned shorts. 

So it seems the warning is triggering without regard to the actual alignment of
the struct and its members and without regard to the actual storage aligment of
the struct. 



$ /usr/bin/clang-4.0 -v 
clang version 4.0.0-svn283054-1~exp1 (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/5.4.1
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/6.2.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.1
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.4.1
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/6.2.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161019/5cc9f445/attachment.html>


More information about the llvm-bugs mailing list