public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17595] New: Unfriendly error message for #pragmas in the middle of a parameter list
@ 2004-09-21 23:28 austern at apple dot com
  2004-09-21 23:33 ` [Bug c++/17595] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: austern at apple dot com @ 2004-09-21 23:28 UTC (permalink / raw)
  To: gcc-bugs

This code
int foo(int x,
#pragma wibble
       int y);

used to be accepted.  For some pragmas there was even a chance that it might do something useful.  
As of today, however, we get this error message instead:
test.c:1: error: expected identifier before 'PRAGMA' token
test.c:1: error: expected `,' or `...' before 'PRAGMA' token
test.c:3: error: ISO C++ forbids declaration of `parameter' with no type

I don't object to forbidding pragmas in the middle of a parameter list, but this is an awfully unfriendly 
error message.  A user who gets this message won't be able to figure out what to do to fix the problem.

-- 
           Summary: Unfriendly error message for #pragmas in the middle of a
                    parameter list
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: austern at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: all
  GCC host triplet: all
GCC target triplet: all


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


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

* [Bug c++/17595] [4.0 Regression] Unfriendly error message for #pragmas in the middle of a parameter list
  2004-09-21 23:28 [Bug c++/17595] New: Unfriendly error message for #pragmas in the middle of a parameter list austern at apple dot com
@ 2004-09-21 23:33 ` pinskia at gcc dot gnu dot org
  2004-09-21 23:41 ` zack at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-21 23:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-21 23:33 -------
In my mind this is a regression as it was accepted before Zack's patch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zack at gcc dot gnu dot org
           Severity|minor                       |normal
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-21 23:33:15
               date|                            |
            Summary|Unfriendly error message for|[4.0 Regression] Unfriendly
                   |#pragmas in the middle of a |error message for #pragmas
                   |parameter list              |in the middle of a parameter
                   |                            |list
   Target Milestone|---                         |4.0.0


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


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

* [Bug c++/17595] [4.0 Regression] Unfriendly error message for #pragmas in the middle of a parameter list
  2004-09-21 23:28 [Bug c++/17595] New: Unfriendly error message for #pragmas in the middle of a parameter list austern at apple dot com
  2004-09-21 23:33 ` [Bug c++/17595] [4.0 Regression] " pinskia at gcc dot gnu dot org
  2004-09-21 23:41 ` zack at gcc dot gnu dot org
@ 2004-09-21 23:41 ` zack at gcc dot gnu dot org
  2004-09-21 23:41 ` austern at apple dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-09-21 23:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at gcc dot gnu dot org  2004-09-21 23:41 -------
I have zero interest in making this construct be accepted; it would require me
to implement backtracking over #pragma (which would mean having some way to undo
its effects) and I disbelieve that there is real-world code that uses it. 
However, I'll take on the chore of making the error message somewhat friendlier.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2004-09-21 23:33:15         |2004-09-21 23:41:07
               date|                            |


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


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

* [Bug c++/17595] [4.0 Regression] Unfriendly error message for #pragmas in the middle of a parameter list
  2004-09-21 23:28 [Bug c++/17595] New: Unfriendly error message for #pragmas in the middle of a parameter list austern at apple dot com
  2004-09-21 23:33 ` [Bug c++/17595] [4.0 Regression] " pinskia at gcc dot gnu dot org
@ 2004-09-21 23:41 ` zack at gcc dot gnu dot org
  2004-09-21 23:41 ` zack at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-09-21 23:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at gcc dot gnu dot org  2004-09-21 23:41 -------
grumble grumble "accept bug" does the wrong thing grumble.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |zack at gcc dot gnu dot org
                   |dot org                     |


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


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

* [Bug c++/17595] [4.0 Regression] Unfriendly error message for #pragmas in the middle of a parameter list
  2004-09-21 23:28 [Bug c++/17595] New: Unfriendly error message for #pragmas in the middle of a parameter list austern at apple dot com
                   ` (2 preceding siblings ...)
  2004-09-21 23:41 ` zack at gcc dot gnu dot org
@ 2004-09-21 23:41 ` austern at apple dot com
  2004-10-06  3:36 ` [Bug c++/17595] [4.0 Regression] Unfriendly error message/rejects legal " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: austern at apple dot com @ 2004-09-21 23:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From austern at apple dot com  2004-09-21 23:41 -------
Subject: Re:  [4.0 Regression] Unfriendly error message for #pragmas in the middle of a parameter list

FWIW, I agree that this is the right decision.



-- 


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


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

* [Bug c++/17595] [4.0 Regression] Unfriendly error message/rejects legal #pragmas in the middle of a parameter list
  2004-09-21 23:28 [Bug c++/17595] New: Unfriendly error message for #pragmas in the middle of a parameter list austern at apple dot com
                   ` (3 preceding siblings ...)
  2004-09-21 23:41 ` austern at apple dot com
@ 2004-10-06  3:36 ` pinskia at gcc dot gnu dot org
  2004-12-23 22:07 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-06  3:36 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-06 03:36 -------
Note that the C front-end accepts the code which is really should be either fixed in the C++ front-end 
or rejected also in the C front-end and for 4.0.0.   In my mind this code should be accepted.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.0 Regression] Unfriendly |[4.0 Regression] Unfriendly
                   |error message for #pragmas  |error message/rejects legal
                   |in the middle of a parameter|#pragmas in the middle of a
                   |list                        |parameter list


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


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

* [Bug c++/17595] [4.0 Regression] Unfriendly error message/rejects legal #pragmas in the middle of a parameter list
  2004-09-21 23:28 [Bug c++/17595] New: Unfriendly error message for #pragmas in the middle of a parameter list austern at apple dot com
                   ` (4 preceding siblings ...)
  2004-10-06  3:36 ` [Bug c++/17595] [4.0 Regression] Unfriendly error message/rejects legal " pinskia at gcc dot gnu dot org
@ 2004-12-23 22:07 ` cvs-commit at gcc dot gnu dot org
  2004-12-23 22:20 ` cvs-commit at gcc dot gnu dot org
  2004-12-23 22:28 ` mmitchel at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-23 22:07 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-23 22:07 -------
Subject: Bug 17595

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-12-23 22:07:02

Modified files:
	gcc/cp         : ChangeLog parser.c 

Log message:
	PR c++/17595
	* parser.c (cp_parser_error): Issue better messages about
	#pragma in locations where it is not permitted.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4558&r2=1.4559
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.297&r2=1.298



-- 


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


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

* [Bug c++/17595] [4.0 Regression] Unfriendly error message/rejects legal #pragmas in the middle of a parameter list
  2004-09-21 23:28 [Bug c++/17595] New: Unfriendly error message for #pragmas in the middle of a parameter list austern at apple dot com
                   ` (5 preceding siblings ...)
  2004-12-23 22:07 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-23 22:20 ` cvs-commit at gcc dot gnu dot org
  2004-12-23 22:28 ` mmitchel at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-12-23 22:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-12-23 22:20 -------
Subject: Bug 17595

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-12-23 22:19:55

Modified files:
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: pragma2.C 

Log message:
	PR c++/17595
	* parser.c (cp_parser_error): Issue better messages about
	#pragma in locations where it is not permitted.
	
	PR c++/17595
	* g++.dg/parse/pragma2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4812&r2=1.4813
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/pragma2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/17595] [4.0 Regression] Unfriendly error message/rejects legal #pragmas in the middle of a parameter list
  2004-09-21 23:28 [Bug c++/17595] New: Unfriendly error message for #pragmas in the middle of a parameter list austern at apple dot com
                   ` (6 preceding siblings ...)
  2004-12-23 22:20 ` cvs-commit at gcc dot gnu dot org
@ 2004-12-23 22:28 ` mmitchel at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-12-23 22:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-12-23 22:28 -------
Fixed in GCC 4.0.

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


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


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

end of thread, other threads:[~2004-12-23 22:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-21 23:28 [Bug c++/17595] New: Unfriendly error message for #pragmas in the middle of a parameter list austern at apple dot com
2004-09-21 23:33 ` [Bug c++/17595] [4.0 Regression] " pinskia at gcc dot gnu dot org
2004-09-21 23:41 ` zack at gcc dot gnu dot org
2004-09-21 23:41 ` zack at gcc dot gnu dot org
2004-09-21 23:41 ` austern at apple dot com
2004-10-06  3:36 ` [Bug c++/17595] [4.0 Regression] Unfriendly error message/rejects legal " pinskia at gcc dot gnu dot org
2004-12-23 22:07 ` cvs-commit at gcc dot gnu dot org
2004-12-23 22:20 ` cvs-commit at gcc dot gnu dot org
2004-12-23 22:28 ` mmitchel 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).