public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/23143] New: [4.1 Regression] parameter forward declarations broken
@ 2005-07-29 23:30 jsm28 at gcc dot gnu dot org
  2005-07-29 23:31 ` [Bug c/23143] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2005-07-29 23:30 UTC (permalink / raw)
  To: gcc-bugs

The new C parser lost a call to mark_forward_parm_decls, thereby completely
breaking the GNU extension of forward parameter declarations.  I'm testing a
patch.  Testcases:

int f1(int a; int a);

should be accepted (rather than complaining about a duplicate parameter name),

int h1(int a; int b);

should be rejected.

Observations:

1. This is the first new C parser bug affecting valid code found since the
parser went in in February.

2. It suggests that no-one is using this extension.

3. I'm surprised that mark_forward_parm_decls didn't get removed as an unused
function after the call was lost.

4. The patch I'm testing restores things to the same functionality as in 4.0. 
There are various cases of invalid code involving this extension which 3.4
diagnoses and 4.0 doesn't; I'll file a separate bug for those.

-- 
           Summary: [4.1 Regression] parameter forward declarations broken
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: jsm28 at gcc dot gnu dot org
        ReportedBy: jsm28 at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23143


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

* [Bug c/23143] [4.1 Regression] parameter forward declarations broken
  2005-07-29 23:30 [Bug c/23143] New: [4.1 Regression] parameter forward declarations broken jsm28 at gcc dot gnu dot org
@ 2005-07-29 23:31 ` pinskia at gcc dot gnu dot org
  2005-07-29 23:58 ` joseph at codesourcery dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-29 23:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-29 23:30 -------
Confirmed.  I did not even know of this extension.  I don't even see it as being a documented one 
either, unless I missed something obvious.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2005-07-29 23:30:30
               date|                            |
   Target Milestone|---                         |4.1.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23143


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

* [Bug c/23143] [4.1 Regression] parameter forward declarations broken
  2005-07-29 23:30 [Bug c/23143] New: [4.1 Regression] parameter forward declarations broken jsm28 at gcc dot gnu dot org
  2005-07-29 23:31 ` [Bug c/23143] " pinskia at gcc dot gnu dot org
@ 2005-07-29 23:58 ` joseph at codesourcery dot com
  2005-07-30  2:12 ` cvs-commit at gcc dot gnu dot org
  2005-07-30  5:33 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: joseph at codesourcery dot com @ 2005-07-29 23:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From joseph at codesourcery dot com  2005-07-29 23:34 -------
Subject: Re:  [4.1 Regression] parameter forward declarations
 broken

On Fri, 29 Jul 2005, pinskia at gcc dot gnu dot org wrote:

> Confirmed.  I did not even know of this extension.  I don't even see it 
> as being a documented one either, unless I missed something obvious.

It's documented in the section of extend.texi on VLAs.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23143


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

* [Bug c/23143] [4.1 Regression] parameter forward declarations broken
  2005-07-29 23:30 [Bug c/23143] New: [4.1 Regression] parameter forward declarations broken jsm28 at gcc dot gnu dot org
  2005-07-29 23:31 ` [Bug c/23143] " pinskia at gcc dot gnu dot org
  2005-07-29 23:58 ` joseph at codesourcery dot com
@ 2005-07-30  2:12 ` cvs-commit at gcc dot gnu dot org
  2005-07-30  5:33 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-07-30  2:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-07-30 01:35 -------
Subject: Bug 23143

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	jsm28@gcc.gnu.org	2005-07-30 01:34:58

Modified files:
	gcc            : ChangeLog c-decl.c c-parser.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: parm-forwdecl-1.c parm-forwdecl-2.c 
	                      parm-forwdecl-3.c parm-forwdecl-4.c 

Log message:
	PR c/23143
	* c-parser.c (c_parser_parms_list_declarator): Call
	mark_forward_parm_decls.
	* c-decl.c (merge_decls): Only check DECL_IN_SYSTEM_HEADER for
	decls with visibility structure.
	
	testsuite:
	* gcc.dg/parm-forwdecl-1.c, gcc.dg/parm-forwdecl-2.c,
	gcc.dg/parm-forwdecl-3.c, gcc.dg/parm-forwdecl-4.c: New tests.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9611&r2=2.9612
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.678&r2=1.679
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-parser.c.diff?cvsroot=gcc&r1=2.20&r2=2.21
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5855&r2=1.5856
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/parm-forwdecl-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/parm-forwdecl-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/parm-forwdecl-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/parm-forwdecl-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23143


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

* [Bug c/23143] [4.1 Regression] parameter forward declarations broken
  2005-07-29 23:30 [Bug c/23143] New: [4.1 Regression] parameter forward declarations broken jsm28 at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-07-30  2:12 ` cvs-commit at gcc dot gnu dot org
@ 2005-07-30  5:33 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-30  5:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-30 03:10 -------
Fixed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23143


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

end of thread, other threads:[~2005-07-30  3:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-29 23:30 [Bug c/23143] New: [4.1 Regression] parameter forward declarations broken jsm28 at gcc dot gnu dot org
2005-07-29 23:31 ` [Bug c/23143] " pinskia at gcc dot gnu dot org
2005-07-29 23:58 ` joseph at codesourcery dot com
2005-07-30  2:12 ` cvs-commit at gcc dot gnu dot org
2005-07-30  5:33 ` pinskia at gcc dot gnu dot org

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).