Bug 188944 - Incorrect warning message 'packed' attribute ignored...
Incorrect warning message 'packed' attribute ignored...
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
rawhide
All Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-13 16:25 EDT by Petr Vandrovec
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-20 08:33:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Vandrovec 2006-04-13 16:25:11 EDT
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 08:33:37 EDT
Fixed upstream, should show up in next rawhide rpms.
http://gcc.gnu.org/ml/gcc-patches/2006-04/msg00730.html

Note You need to log in before you can comment on or make changes to this bug.