public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/6660: Typedeffed unnamed structs/unions do not compile with gcc-3.1
@ 2002-05-21 11:45 neil
  0 siblings, 0 replies; 7+ messages in thread
From: neil @ 2002-05-21 11:45 UTC (permalink / raw)
  To: aia21, gcc-bugs, gcc-prs, jsm28, linux-ntfs-dev, nobody

Synopsis: Typedeffed unnamed structs/unions do not compile with gcc-3.1

Responsible-Changed-From-To: unassigned->jsm28
Responsible-Changed-By: neil
Responsible-Changed-When: Tue May 21 11:45:30 2002
Responsible-Changed-Why:
    Yours Joseph, I believe you did the code.  If this is
    a bug, it's a regression, so I've marked it high.
State-Changed-From-To: open->analyzed
State-Changed-By: neil
State-Changed-When: Tue May 21 11:45:30 2002
State-Changed-Why:
    Seems reasonable.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6660


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: c/6660: Typedeffed unnamed structs/unions do not compile with gcc-3.1
@ 2002-10-16 16:35 gerald
  0 siblings, 0 replies; 7+ messages in thread
From: gerald @ 2002-10-16 16:35 UTC (permalink / raw)
  To: aia21, gcc-bugs, gcc-prs, jakub, linux-ntfs-dev

Synopsis: Typedeffed unnamed structs/unions do not compile with gcc-3.1

State-Changed-From-To: analyzed->closed
State-Changed-By: gerald
State-Changed-When: Wed Oct 16 16:35:17 2002
State-Changed-Why:
    Fixed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6660


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: c/6660: Typedeffed unnamed structs/unions do not compile with gcc-3.1
@ 2002-10-16 13:56 Anton Altaparmakov
  0 siblings, 0 replies; 7+ messages in thread
From: Anton Altaparmakov @ 2002-10-16 13:56 UTC (permalink / raw)
  To: jakub; +Cc: gcc-prs

The following reply was made to PR c/6660; it has been noted by GNATS.

From: Anton Altaparmakov <aia21@cantab.net>
To: Nathanael Nerode <neroden@twcny.rr.com>
Cc: jakub@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, 
    gcc-bugs@gcc.gnu.org, linux-ntfs-dev@lists.sourceforge.net
Subject: Re: c/6660: Typedeffed unnamed structs/unions do not compile with gcc-3.1
Date: Wed, 16 Oct 2002 21:49:22 +0100 (BST)

 On Wed, 16 Oct 2002, Nathanael Nerode wrote:
 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6660
 > 
 > Jakub, your recent patch appears to have fixed this.
 > 
 > Anton, can you confirm that it's working now so I can close the bug report?
 
 It is working with gcc-3.2 as found in Mandrake 9.0 so I think I can
 safely say yes. (-:
 
 Best regards,
 
 	Anton
 -- 
 Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
 Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
 WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: c/6660: Typedeffed unnamed structs/unions do not compile with gcc-3.1
@ 2002-10-16  7:57 Nathanael Nerode
  0 siblings, 0 replies; 7+ messages in thread
From: Nathanael Nerode @ 2002-10-16  7:57 UTC (permalink / raw)
  To: jakub; +Cc: gcc-prs

The following reply was made to PR c/6660; it has been noted by GNATS.

From: Nathanael Nerode <neroden@twcny.rr.com>
To: jakub@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   aia21@cantab.net, gcc-bugs@gcc.gnu.org,
   linux-ntfs-dev@lists.sourceforge.net
Cc:  
Subject: Re: c/6660: Typedeffed unnamed structs/unions do not compile with
 gcc-3.1
Date: Wed, 16 Oct 2002 10:47:47 -0400

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6660
 
 Jakub, your recent patch appears to have fixed this.
 
 Anton, can you confirm that it's working now so I can close the bug report?
 
 --Nathaanel
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: c/6660: Typedeffed unnamed structs/unions do not compile with gcc-3.1
@ 2002-05-27  5:46 jakub
  0 siblings, 0 replies; 7+ messages in thread
From: jakub @ 2002-05-27  5:46 UTC (permalink / raw)
  To: aia21, dj, gcc-bugs, gcc-prs, jakub, linux-ntfs-dev

Synopsis: Typedeffed unnamed structs/unions do not compile with gcc-3.1

Responsible-Changed-From-To: dj->jakub
Responsible-Changed-By: jakub
Responsible-Changed-When: Mon May 27 05:36:34 2002
Responsible-Changed-Why:
    Fix just posted to gcc-patches.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6660


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: c/6660: Typedeffed unnamed structs/unions do not compile with gcc-3.1
@ 2002-05-21 12:41 jsm28
  0 siblings, 0 replies; 7+ messages in thread
From: jsm28 @ 2002-05-21 12:41 UTC (permalink / raw)
  To: aia21, dj, gcc-bugs, gcc-prs, jsm28, linux-ntfs-dev

Synopsis: Typedeffed unnamed structs/unions do not compile with gcc-3.1

Responsible-Changed-From-To: jsm28->dj
Responsible-Changed-By: jsm28
Responsible-Changed-When: Tue May 21 12:41:25 2002
Responsible-Changed-Why:
    I believe the relevant patch was:
    
    2001-10-08  DJ Delorie  <dj@redhat.com>
    
            * c-decl.c (grokfield): Make sure the only unnamed fields
            we're allowing are either structs or unions.
            * doc/extend.texi: Add documentation for the unnamed field
            extension.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6660


^ permalink raw reply	[flat|nested] 7+ messages in thread

* c/6660: Typedeffed unnamed structs/unions do not compile with gcc-3.1
@ 2002-05-14 18:36 aia21
  0 siblings, 0 replies; 7+ messages in thread
From: aia21 @ 2002-05-14 18:36 UTC (permalink / raw)
  To: gcc-gnats; +Cc: linux-ntfs-dev


>Number:         6660
>Category:       c
>Synopsis:       Typedeffed unnamed structs/unions do not compile with gcc-3.1
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue May 14 18:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Anton Altaparmakov
>Release:        gcc 3.1
>Organization:
>Environment:
Linux, compiling Linux kernel 2.5.15 (same applies since kernel version 2.5.11)
>Description:
This is regarding gcc-3.1: Sorry can't give more details about the gcc version but several users of gcc-3.1 have now complained to us that they cannot compile 2.5.12 and above kernels with gcc-3.1 because of this. (2.5.12 is when the new ntfs driver was introduced which uses the unnamed structs/unions.)

gcc-3.1 gives the error: unnamed fields of type other than struct or union are not allowed

However the unnamed field is a typedeffed unnamed struct/union (we have both in the code).

e.g. the first error during kernel 2.5.15 compilation hits fs/ntfs/aops.c in the include file fs/ntfs/layout.h:

gcc -D__KERNEL__ -I/usr/src/linux-2.5.15/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686  -DNTFS_VERSION=\"2.0.6\" -DDEBUG -DKBUILD_BASENAME=aops  -c -o aops.o aops.c
In file included from attrib.h:31,
                 from debug.h:31,
                 from ntfs.h:43,
                 from aops.c:30:
layout.h:299: unnamed fields of type other than struct or union are not allowed

What it is complaining about is this code in layout.h:

typedef struct {
        NTFS_RECORD_TYPES magic; // this is an enumeration
        u16 usa_ofs;
        u16 usa_count;
} __attribute__ ((__packed__)) NTFS_RECORD;

typedef struct {
        NTFS_RECORD;  // this is line 299 on which gcc barfs
        blah...
} __attribute__ ((__packed__)) MFT_RECORD;

Clearly this code is just fine and it used to work with gcc-2.96 and gcc-3.0.x.

I believe this is a bug in gcc-3.1 causing it to not understand that NTFS_RECORD is actually a struct/union, just a typedeffed one but all the same. Having to keep typing "struct NTFS_RECORD" is silly hence why I typedef everything.

If this is not a bug but a feature than I would kindly request that you remove that feature and restore the old behaviour present in gcc-2.96 and gcc-3.0.x...

(Yes I know gcc-2.96 is not an official gcc release, so no need to rant about that.)

I would appreciate your comments on this...

Best regards,

       Anton
-- 
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-10-16 23:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-21 11:45 c/6660: Typedeffed unnamed structs/unions do not compile with gcc-3.1 neil
  -- strict thread matches above, loose matches on Subject: below --
2002-10-16 16:35 gerald
2002-10-16 13:56 Anton Altaparmakov
2002-10-16  7:57 Nathanael Nerode
2002-05-27  5:46 jakub
2002-05-21 12:41 jsm28
2002-05-14 18:36 aia21

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).