public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call
@ 2003-10-23 14:18 gabor dot greif at lucent dot com
  2003-10-24  6:16 ` [Bug preprocessor/12743] [3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: gabor dot greif at lucent dot com @ 2003-10-23 14:18 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: Multi-line strings not diagnosed when occurring in a
                    macro call
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gabor dot greif at lucent dot com
                CC: gcc-bugs at gcc dot gnu dot org

Compile this snippet:

----------------------
#define FOO(X) wagga X
    FOO(("kkkk
llll"));
----------------------

In gcc-3.4 I get these errors:

foo.C:100:1: unterminated argument list invoking macro "FOO"
foo.C:2: error: `FOO' undeclared (first use this function)
foo.C:2: error: (Each undeclared identifier is reported only once for each
function it appears in.)
foo.C:2: error: expected `;'
foo.C:2: error: expected `}'

Especially the first one is annoying, as it directs me to
the end of the file (which is usually far away :-)

In non-macro context multiline strings are correctly noted as an error.


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

* [Bug preprocessor/12743] [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
@ 2003-10-24  6:16 ` pinskia at gcc dot gnu dot org
  2003-10-24 12:55   ` Neil Booth
  2003-10-24 13:02 ` neil at daikokuya dot co dot uk
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-10-24  6:16 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-10-24 06:02:13
               date|                            |
            Summary|Multi-line strings not      |[3.4 Regression] Multi-line
                   |diagnosed when occurring in |strings not diagnosed when
                   |a macro call                |occurring in a macro call
   Target Milestone|---                         |3.4


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-10-24 06:02 -------
Using phil's regression hunter by hand I find that this is a regression and was introduced between 
2003-04-23 and 2003-04-24.


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

* Re: [Bug preprocessor/12743] [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-24  6:16 ` [Bug preprocessor/12743] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2003-10-24 12:55   ` Neil Booth
  0 siblings, 0 replies; 15+ messages in thread
From: Neil Booth @ 2003-10-24 12:55 UTC (permalink / raw)
  To: pinskia at gcc dot gnu dot org; +Cc: gcc-bugs

pinskia at gcc dot gnu dot org wrote:-

> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12743
> 
> 
> pinskia at gcc dot gnu dot org changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |NEW
>      Ever Confirmed|                            |1
>    Last reconfirmed|0000-00-00 00:00:00         |2003-10-24 06:02:13
>                date|                            |
>             Summary|Multi-line strings not      |[3.4 Regression] Multi-line
>                    |diagnosed when occurring in |strings not diagnosed when
>                    |a macro call                |occurring in a macro call
>    Target Milestone|---                         |3.4

This is intended behaviour.  It's undefined according to the
standard, and I changed the way we do it in 3.4.

Neil.


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

* [Bug preprocessor/12743] [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
  2003-10-24  6:16 ` [Bug preprocessor/12743] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2003-10-24 13:02 ` neil at daikokuya dot co dot uk
  2003-10-24 13:43 ` ggreif at lucent dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: neil at daikokuya dot co dot uk @ 2003-10-24 13:02 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From neil at daikokuya dot co dot uk  2003-10-24 12:55 -------
Subject: Re:  [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call

pinskia at gcc dot gnu dot org wrote:-

> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12743
> 
> 
> pinskia at gcc dot gnu dot org changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|UNCONFIRMED                 |NEW
>      Ever Confirmed|                            |1
>    Last reconfirmed|0000-00-00 00:00:00         |2003-10-24 06:02:13
>                date|                            |
>             Summary|Multi-line strings not      |[3.4 Regression] Multi-line
>                    |diagnosed when occurring in |strings not diagnosed when
>                    |a macro call                |occurring in a macro call
>    Target Milestone|---                         |3.4

This is intended behaviour.  It's undefined according to the
standard, and I changed the way we do it in 3.4.

Neil.


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

* [Bug preprocessor/12743] [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
  2003-10-24  6:16 ` [Bug preprocessor/12743] [3.4 Regression] " pinskia at gcc dot gnu dot org
  2003-10-24 13:02 ` neil at daikokuya dot co dot uk
@ 2003-10-24 13:43 ` ggreif at lucent dot com
  2003-10-24 15:28 ` jsm at polyomino dot org dot uk
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: ggreif at lucent dot com @ 2003-10-24 13:43 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From ggreif at lucent dot com  2003-10-24 13:41 -------
Subject: Re:  [3.4 Regression] Multi-line strings
 not diagnosed when occurring in a macro call

neil at daikokuya dot co dot uk wrote:
> 
> 
> This is intended behaviour.  It's undefined according to the
> standard, and I changed the way we do it in 3.4.
> 
> Neil.

I readily accept that this is forbidden by the standard,
I just wanted to criticize that the error message is
directing me to the end of the file being compiled.

I find that old code sometimes has such constructs a dozen
times, and without a line number it is _really_ hard to find
them in the code.

In fact I request that the reported line number refers to the
location of the multi-line string and tell me "multi-line string
literals are not supported any more".

The emphasis is the line number.


Thanks anyway for the prompt response,

	Gabor


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

* [Bug preprocessor/12743] [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
                   ` (2 preceding siblings ...)
  2003-10-24 13:43 ` ggreif at lucent dot com
@ 2003-10-24 15:28 ` jsm at polyomino dot org dot uk
  2003-12-19  9:45 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: jsm at polyomino dot org dot uk @ 2003-10-24 15:28 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From jsm at polyomino dot org dot uk  2003-10-24 15:26 -------
Subject: Re:  [3.4 Regression] Multi-line strings
 not diagnosed when occurring in a macro call

On Fri, 24 Oct 2003, neil at daikokuya dot co dot uk wrote:

> This is intended behaviour.  It's undefined according to the
> standard, and I changed the way we do it in 3.4.

Although undefined so the standard doesn't _require_ diagnostics (for
unterminated string and character constants) there's a clear regression in
usefulness that unportable code with such unterminated constants
(_wherever_ they appear, including in skipped blocks or #error or #warning
lines or macro definitions) no longer receives diagnostics to indicate
their unportability (even with -pedantic -Wall -Wextra).  AFAICT there's
also a documentedness regression (I don't recall any response to my
request <http://gcc.gnu.org/ml/gcc-patches/2003-04/msg01855.html> for
documentation of these extensions, and don't see any such documentation in
the CPP manual).


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

* [Bug preprocessor/12743] [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
                   ` (3 preceding siblings ...)
  2003-10-24 15:28 ` jsm at polyomino dot org dot uk
@ 2003-12-19  9:45 ` pinskia at gcc dot gnu dot org
  2004-01-10 22:45 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-19  9:45 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |documentation
   Last reconfirmed|2003-10-24 06:02:13         |2003-12-19 09:43:46
               date|                            |


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


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

* [Bug preprocessor/12743] [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
                   ` (4 preceding siblings ...)
  2003-12-19  9:45 ` pinskia at gcc dot gnu dot org
@ 2004-01-10 22:45 ` pinskia at gcc dot gnu dot org
  2004-01-10 22:54 ` jsm at polyomino dot org dot uk
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-10 22:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-10 22:45 -------
Not that important for blocking the release of 3.4 so moving to 3.5.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
   Target Milestone|3.4.0                       |3.5.0


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


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

* [Bug preprocessor/12743] [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
                   ` (5 preceding siblings ...)
  2004-01-10 22:45 ` pinskia at gcc dot gnu dot org
@ 2004-01-10 22:54 ` jsm at polyomino dot org dot uk
  2004-01-10 23:08 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: jsm at polyomino dot org dot uk @ 2004-01-10 22:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jsm at polyomino dot org dot uk  2004-01-10 22:54 -------
Subject: Re:  [3.4 Regression] Multi-line strings
 not diagnosed when occurring in a macro call

On Sat, 10 Jan 2004, pinskia at gcc dot gnu dot org wrote:

> Not that important for blocking the release of 3.4 so moving to 3.5.

Remember in general the possibility of moving 3.4 regressions to 3.4.1
rather than 3.5 until it's decided that they aren't going to be fixed in
that release series at all.



-- 


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


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

* [Bug preprocessor/12743] [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
                   ` (6 preceding siblings ...)
  2004-01-10 22:54 ` jsm at polyomino dot org dot uk
@ 2004-01-10 23:08 ` pinskia at gcc dot gnu dot org
  2004-01-12 23:39 ` steven at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-10 23:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-10 23:08 -------
Okay moving to 3.4.1 which I just created for this reason.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.5.0                       |3.4.1


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


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

* [Bug preprocessor/12743] [3.4 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
                   ` (7 preceding siblings ...)
  2004-01-10 23:08 ` pinskia at gcc dot gnu dot org
@ 2004-01-12 23:39 ` steven at gcc dot gnu dot org
  2004-02-28  3:29 ` [Bug preprocessor/12743] [3.4/3.5 " mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-01-12 23:39 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2004-01-12 23:39 -------
Move back the target for all regressions from 3.4.1 to 3.4.0, as required by 
our bug management policy. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4.1                       |3.4.0


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


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

* [Bug preprocessor/12743] [3.4/3.5 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
                   ` (8 preceding siblings ...)
  2004-01-12 23:39 ` steven at gcc dot gnu dot org
@ 2004-02-28  3:29 ` mmitchel at gcc dot gnu dot org
  2004-02-28 10:32 ` neil at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-02-28  3:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-02-28 03:29 -------
Neil, there really should be an error for this case, at least with pedantic.

Would you please add such a diagnostic if one does not already exist?

We can wait until 3.4.1 for this, though.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |neil at daikokuya dot co dot
                   |                            |uk
         AssignedTo|unassigned at gcc dot gnu   |neil at daikokuya dot co dot
                   |dot org                     |uk
             Status|NEW                         |ASSIGNED
   Target Milestone|3.4.0                       |3.4.1


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


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

* [Bug preprocessor/12743] [3.4/3.5 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
                   ` (9 preceding siblings ...)
  2004-02-28  3:29 ` [Bug preprocessor/12743] [3.4/3.5 " mmitchel at gcc dot gnu dot org
@ 2004-02-28 10:32 ` neil at gcc dot gnu dot org
  2004-03-13 15:06 ` neil at gcc dot gnu dot org
  2004-03-13 15:14 ` jsm at polyomino dot org dot uk
  12 siblings, 0 replies; 15+ messages in thread
From: neil at gcc dot gnu dot org @ 2004-02-28 10:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From neil at gcc dot gnu dot org  2004-02-28 10:32 -------
Contrary to the bug report's claim, in 3.4 I get

/tmp/bug.c:3:1: unterminated argument list invoking macro "FOO"
    FOO

This is the behaviour I intended.  If someone wants different behaviour, they
are free to implement it.  I'll note that e.g. Comeau gives substantially the
same output.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|neil at daikokuya dot co dot|unassigned at gcc dot gnu
                   |uk                          |dot org
             Status|ASSIGNED                    |NEW


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


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

* [Bug preprocessor/12743] [3.4/3.5 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
                   ` (10 preceding siblings ...)
  2004-02-28 10:32 ` neil at gcc dot gnu dot org
@ 2004-03-13 15:06 ` neil at gcc dot gnu dot org
  2004-03-13 15:14 ` jsm at polyomino dot org dot uk
  12 siblings, 0 replies; 15+ messages in thread
From: neil at gcc dot gnu dot org @ 2004-03-13 15:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From neil at gcc dot gnu dot org  2004-03-13 15:06 -------
Not a bug.

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


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


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

* [Bug preprocessor/12743] [3.4/3.5 Regression] Multi-line strings not diagnosed when occurring in a macro call
  2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
                   ` (11 preceding siblings ...)
  2004-03-13 15:06 ` neil at gcc dot gnu dot org
@ 2004-03-13 15:14 ` jsm at polyomino dot org dot uk
  12 siblings, 0 replies; 15+ messages in thread
From: jsm at polyomino dot org dot uk @ 2004-03-13 15:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From jsm at polyomino dot org dot uk  2004-03-13 15:14 -------
Subject: Re:  [3.4/3.5 Regression] Multi-line strings
 not diagnosed when occurring in a macro call

On Sat, 13 Mar 2004, neil at gcc dot gnu dot org wrote:

> Not a bug.

There's still the clear quality of implementation regression that

#if 0
'
#endif

receives no diagnostics for its unportability (even with -pedantic -Wall
-W).  There is also a documentedness regression which I previously pointed
out in the message referenced in the logs for this bug report; not only
are these extensions concerning unterminated literals undocumented, they
expressly contradict parts of the cpp manual.



-- 


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


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

end of thread, other threads:[~2004-03-13 15:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-23 14:18 [Bug preprocessor/12743] New: Multi-line strings not diagnosed when occurring in a macro call gabor dot greif at lucent dot com
2003-10-24  6:16 ` [Bug preprocessor/12743] [3.4 Regression] " pinskia at gcc dot gnu dot org
2003-10-24 12:55   ` Neil Booth
2003-10-24 13:02 ` neil at daikokuya dot co dot uk
2003-10-24 13:43 ` ggreif at lucent dot com
2003-10-24 15:28 ` jsm at polyomino dot org dot uk
2003-12-19  9:45 ` pinskia at gcc dot gnu dot org
2004-01-10 22:45 ` pinskia at gcc dot gnu dot org
2004-01-10 22:54 ` jsm at polyomino dot org dot uk
2004-01-10 23:08 ` pinskia at gcc dot gnu dot org
2004-01-12 23:39 ` steven at gcc dot gnu dot org
2004-02-28  3:29 ` [Bug preprocessor/12743] [3.4/3.5 " mmitchel at gcc dot gnu dot org
2004-02-28 10:32 ` neil at gcc dot gnu dot org
2004-03-13 15:06 ` neil at gcc dot gnu dot org
2004-03-13 15:14 ` jsm at polyomino dot org dot uk

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