Bug 188944 - Incorrect warning message 'packed' attribute ignored...
Summary: Incorrect warning message 'packed' attribute ignored...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-13 20:25 UTC by Petr Vandrovec
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-04-20 12:33:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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


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