Bug 188944

Summary: Incorrect warning message 'packed' attribute ignored...
Product: [Fedora] Fedora Reporter: Petr Vandrovec <petr>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED UPSTREAM QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-04-20 12:33:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Vandrovec 2006-04-13 20:25:11 UTC
Description of problem:

I've tried to build ncpfs with gcc-4.1 and lot of warnings was emited about
redundant 'packed' attribute (I'll fix them, but that's not problem).  Problem
is that for array fields it does not print array size, but index of last field.

Version-Release number of selected component (if applicable):

4.1.0-6

How reproducible:

Always.

Steps to Reproduce:

petr-lx:/tmp$ cat x.c
struct test {
        unsigned char field[1] __attribute__((packed));
} __attribute__((packed));
petr-lx:/tmp$ gcc -c -W x.c
x.c:2: warning: 'packed' attribute ignored for field of type 'unsigned char[0u]'
petr-lx:/tmp$ gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre
--with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.0 20060406 (Red Hat 4.1.0-6)
  
Actual results:

x.c:2: warning: 'packed' attribute ignored for field of type 'unsigned char[0u]'

Expected results:

x.c:2: warning: 'packed' attribute ignored for field of type 'unsigned char[1]'

Additional info:

unsigned char[] is reported correctly.  And it would be nice to get rid of 'u'
suffix...

Comment 1 Jakub Jelinek 2006-04-20 12:33:37 UTC
Fixed upstream, should show up in next rawhide rpms.
http://gcc.gnu.org/ml/gcc-patches/2006-04/msg00730.html