public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error
@ 2004-10-05 20:14 pinskia at gcc dot gnu dot org
  2004-10-05 20:16 ` [Bug c++/17852] " pinskia at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-05 20:14 UTC (permalink / raw)
  To: gcc-bugs

struct B
{
    int foo(size_t);
};

gives:
tt.cc:3: error: expected %<;%> before '(' token
which is wrong.

-- 
           Summary: [4.0 Regression] werid quoting with synax error
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,gdr at gcc dot gnu dot
                    org


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


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

* [Bug c++/17852] [4.0 Regression] werid quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
@ 2004-10-05 20:16 ` pinskia at gcc dot gnu dot org
  2004-10-05 20:19 ` pinskia at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-05 20:16 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

* [Bug c++/17852] [4.0 Regression] werid quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
  2004-10-05 20:16 ` [Bug c++/17852] " pinskia at gcc dot gnu dot org
@ 2004-10-05 20:19 ` pinskia at gcc dot gnu dot org
  2004-10-05 20:40 ` gdr at cs dot tamu dot edu
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-05 20:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-05 20:19 -------
The problem is the error message passed into c_parse_error is outputted by %s which just outputs that 
string. 

-- 


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


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

* [Bug c++/17852] [4.0 Regression] werid quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
  2004-10-05 20:16 ` [Bug c++/17852] " pinskia at gcc dot gnu dot org
  2004-10-05 20:19 ` pinskia at gcc dot gnu dot org
@ 2004-10-05 20:40 ` gdr at cs dot tamu dot edu
  2004-10-05 20:53 ` [Bug c++/17852] [4.0 Regression] weird " bangerth at dealii dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: gdr at cs dot tamu dot edu @ 2004-10-05 20:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at cs dot tamu dot edu  2004-10-05 20:40 -------
Subject: Re:  [4.0 Regression] werid quoting with synax error

"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| The problem is the error message passed into c_parse_error is
| outputted by %s which just outputs that string. 

Thanks for the analyzis.  I'll deal with it.
(I thought JSM converted the C front-end to use the full diagnostic
message). 

-- Gaby


-- 


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


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

* [Bug c++/17852] [4.0 Regression] weird quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-10-05 20:40 ` gdr at cs dot tamu dot edu
@ 2004-10-05 20:53 ` bangerth at dealii dot org
  2004-10-06 13:15 ` reichelt at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2004-10-05 20:53 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.0 Regression] werid      |[4.0 Regression] weird
                   |quoting with synax error    |quoting with synax error


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


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

* [Bug c++/17852] [4.0 Regression] weird quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-10-05 20:53 ` [Bug c++/17852] [4.0 Regression] weird " bangerth at dealii dot org
@ 2004-10-06 13:15 ` reichelt at gcc dot gnu dot org
  2004-10-15  4:44 ` mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-06 13:15 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-10-06 13:15:53
               date|                            |


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


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

* [Bug c++/17852] [4.0 Regression] weird quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-10-06 13:15 ` reichelt at gcc dot gnu dot org
@ 2004-10-15  4:44 ` mmitchel at gcc dot gnu dot org
  2004-10-15 21:12 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-15  4:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-10-15 04:44 -------
Gaby volunteered for this bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |gdr at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/17852] [4.0 Regression] weird quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-10-15  4:44 ` mmitchel at gcc dot gnu dot org
@ 2004-10-15 21:12 ` cvs-commit at gcc dot gnu dot org
  2004-10-15 21:18 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-15 21:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-15 21:11 -------
Subject: Bug 17852

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-10-15 21:11:50

Modified files:
	gcc/cp         : ChangeLog decl.c parser.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/init: dso_handle1.C 
	gcc/testsuite/g++.dg/parse: pragma1.C typedef6.C 

Log message:
	PR c++/17042
	* decl.c (declare_global_var): Use the return value from pushdecl.
	
	PR c++/14667
	* parser.c (cp_parser_simple_declaration): Do not diagnose invalid
	type names if we have already found a valid type.
	(cp_parser_member_declaration): Likewise.
	
	PR c++/17852
	* parser.c (cp_parser_member_specification_opt): Handle
	CPP_PRAGMA.
	
	PR c++/17042
	* g++.dg/init/dso_handle1.C: New test.
	
	PR c++/17852
	* g++.dg/parse/pragma1.C: New test.
	
	PR c++/14667
	* g++.dg/parse/typedef6.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4437&r2=1.4438
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1315&r2=1.1316
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.263&r2=1.264
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4459&r2=1.4460
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/dso_handle1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/pragma1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/typedef6.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/17852] [4.0 Regression] weird quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-10-15 21:12 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-15 21:18 ` cvs-commit at gcc dot gnu dot org
  2004-10-19 15:56 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-15 21:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-15 21:18 -------
Subject: Bug 17852

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-10-15 21:18:08

Modified files:
	gcc/cp         : ChangeLog 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/parse: pragma1.C 

Log message:
	PR c++/17042
	* decl.c (declare_global_var): Use the return value from pushdecl.
	
	PR c++/14667
	* parser.c (cp_parser_simple_declaration): Do not diagnose invalid
	type names if we have already found a valid type.
	(cp_parser_member_declaration): Likewise.
	
	PR c++/17852
	* parser.c (cp_parser_member_specification_opt): Handle
	CPP_PRAGMA.
	
	PR c++/17042
	* g++.dg/init/dso_handle1.C: New test.
	
	PR c++/17852
	* g++.dg/parse/pragma1.C: New test.
	
	PR c++/14667
	* g++.dg/parse/typedef6.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4438&r2=1.4439
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4460&r2=1.4461
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/pragma1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2



-- 


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


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

* [Bug c++/17852] [4.0 Regression] weird quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2004-10-15 21:18 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-19 15:56 ` pinskia at gcc dot gnu dot org
  2004-10-19 17:28 ` jsm at polyomino dot org dot uk
  2004-10-31  4:48 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-19 15:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-19 15:56 -------
*** Bug 18059 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathan at gcc dot gnu dot
                   |                            |org


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


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

* [Bug c++/17852] [4.0 Regression] weird quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2004-10-19 15:56 ` pinskia at gcc dot gnu dot org
@ 2004-10-19 17:28 ` jsm at polyomino dot org dot uk
  2004-10-31  4:48 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: jsm at polyomino dot org dot uk @ 2004-10-19 17:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jsm at polyomino dot org dot uk  2004-10-19 17:28 -------
Subject: Re:  Re: [Bug c/18059] New: bad diagnostic formatting

On Tue, 19 Oct 2004, nathan at gcc dot gnu dot org wrote:

> c-common.c contains
>   void c_parse_error (const char *msgid, enum cpp_ttype token, tree value)
> 
> which purports to format msgid, however, it contains things like,
>    error ("%s at end of input", string);
> thus any magic %< in MSGID do not get munged.  Resulting in,
>  error: expected %<,%> or %<...%> before '>' token
> 
> There needs to be a nesting mechanism to pass a format string as a % escape.

That the parameter is called msgid simply means it is translated - which 
it is.  There are at least three separate bugs here.

(1) The C++ front end shouldn't, for now, use these escapes in strings 
passed to c_parse_error.

(2) The message parameter to cp_parser_error is called "message" rather 
than "msgid", so the messages don't get in the message catalog.  Much the 
same applies to several other functions in the C++ parser: 
cp_parser_require, cp_parser_name_lookup_error, 
cp_parser_non_integral_constant_expression all take English arguments that 
aren't marked for translation and may not end up getting passed to _() in 
all cases.  cp_parser_require also concatenates the argument with the 
string "expected ".  The type_definition_forbidden_message structure 
member has a similar problem.

(3) c_parse_error combines a string (which may need %< and %>) with 
another part of a sentence with %s.  Combining sentence fragments cannot 
work with i18n, apart from the problems with message formatting.  The 
source code must contain all the full sentences output even though this 
bulks up the source by needing 8 different "expected .. before ..." in the 
error function call for every parser error: only that way can all the 
sentences be translated properly.  Making each call pass eight arguments 
rather than one is fortunately a fairly mechanical change, as the new 
arguments are derived from the existing one in a fixed way.



-- 


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


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

* [Bug c++/17852] [4.0 Regression] weird quoting with synax error
  2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2004-10-19 17:28 ` jsm at polyomino dot org dot uk
@ 2004-10-31  4:48 ` pinskia at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-31  4:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-31 04:48 -------
Fixed by:
2004-10-30  Gabriel Dos Reis  <gdr@integrable-solutions.net>

        * c-common.c (catenate_strings): New.
        (c_parse_error): Use it.  Don't over-escape.


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


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


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

end of thread, other threads:[~2004-10-31  4:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-05 20:14 [Bug c++/17852] New: [4.0 Regression] werid quoting with synax error pinskia at gcc dot gnu dot org
2004-10-05 20:16 ` [Bug c++/17852] " pinskia at gcc dot gnu dot org
2004-10-05 20:19 ` pinskia at gcc dot gnu dot org
2004-10-05 20:40 ` gdr at cs dot tamu dot edu
2004-10-05 20:53 ` [Bug c++/17852] [4.0 Regression] weird " bangerth at dealii dot org
2004-10-06 13:15 ` reichelt at gcc dot gnu dot org
2004-10-15  4:44 ` mmitchel at gcc dot gnu dot org
2004-10-15 21:12 ` cvs-commit at gcc dot gnu dot org
2004-10-15 21:18 ` cvs-commit at gcc dot gnu dot org
2004-10-19 15:56 ` pinskia at gcc dot gnu dot org
2004-10-19 17:28 ` jsm at polyomino dot org dot uk
2004-10-31  4:48 ` 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).