public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: preprocessor/2219
@ 2001-04-01  0:00 Neil Booth
  0 siblings, 0 replies; 4+ messages in thread
From: Neil Booth @ 2001-04-01  0:00 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Neil Booth <neil@daikokuya.demon.co.uk>
To: Jeremy Elson <jelson@circlemud.org>
Cc: neil@gcc.gnu.org, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: preprocessor/2219
Date: Thu, 8 Mar 2001 07:53:21 +0000

 Jeremy Elson wrote:-
 
 > By the way, I should also say that the identical code compiled under
 > previous versions of GCC (e.g. 2.95) does not give a warning.
 > I only saw this warning after upgrading to one of the 2.97 snapshots.
 
 Don't post a bug report, 'coz I'll just close it :-)
 
 You can send me your code in private if you like.  GCC 2.95.2 was less
 standards-coming, or precise if you like, than the current preprocessor.
 
 You can still use ## to suppress unwanted ',', but it appears you're
 not using it that way correctly.
 
 Neil.


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

* Re: preprocessor/2219
@ 2001-04-01  0:00 Jeremy Elson
  0 siblings, 0 replies; 4+ messages in thread
From: Jeremy Elson @ 2001-04-01  0:00 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Jeremy Elson <jelson@circlemud.org>
To: Neil Booth <neil@daikokuya.demon.co.uk>
Cc: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: preprocessor/2219 
Date: Thu, 08 Mar 2001 10:59:14 -0800

 Neil Booth writes:
 >Like I said, the ## serves no purpose (apart from maybe preventing macro
 >expansion - this use of it here is no longer supported).  Just remove
 >it.
 
 So - yes, I understand that in my particular code fragment, the ## is
 not necessary because using my macro in the form of "RDEBUG(0)" is not
 legal.  And in my real program, I had already removed the ## even
 before writing to you.
 
 I was just reporting what I thought was incorrect behavior for the
 "good of GCC", because it seemed that GCC's treatment of the ## did
 not match what the documentation described.  Since the preprocessor
 was taking what appeared to be valid code according to the
 documentation, and emitting valid code according to how the
 documentation specified, but was still giving a warning, I thought I
 would tell you folks about it. 
 
 The linux kernel makes uuse of the same "##" construct I sent in my
 example, so you might get more bug reports about the same thing in the
 future.
 
 But, if this is correct behavior after all, then, forget the whole
 thing :-)
 
 Cheers,
 -Jer


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

* Re: preprocessor/2219
@ 2001-04-01  0:00 neil
  0 siblings, 0 replies; 4+ messages in thread
From: neil @ 2001-04-01  0:00 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: neil@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org, jelson@circlemud.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: preprocessor/2219
Date: 8 Mar 2001 07:35:35 -0000

 Synopsis: Using "##" with macro varargs generates spurious warning
 
 State-Changed-From-To: open->closed
 State-Changed-By: neil
 State-Changed-When: Wed Mar  7 23:35:35 2001
 State-Changed-Why:
     The message is correct.  You cannot paste the two tokens
     and get a valid preprocessing token.  The only token
     beginning with a '(' is the '(' token itself.  The only
     thing that can be pre-pasted with a string literal is the
     letter 'L' to make it wide.
     
     Try removing the ##, you probably don't need it.
     I can't be sure how to fix your problem, because there is
     no attachment.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2219&database=gcc


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

* Re: preprocessor/2219
@ 2001-04-01  0:00 Neil Booth
  0 siblings, 0 replies; 4+ messages in thread
From: Neil Booth @ 2001-04-01  0:00 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Neil Booth <neil@daikokuya.demon.co.uk>
To: Jeremy Elson <jelson@circlemud.org>
Cc: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Subject: Re: preprocessor/2219
Date: Thu, 8 Mar 2001 18:49:26 +0000

 Jeremy Elson wrote:-
 
 > Sure - here it is.  Compiles fine under 2.95 and gives a warning under
 > 2.97:
 > 
 > 
 >  #define RDEBUG(message_level, args...) do { \
 >    if (debug_level >= message_level) rdebug_real(##args); \
 > } while(0)
 > 
 > int debug_level;
 > 
 > static void rdebug_real(char *fmt, ...)
 > {
 >   /* in the real code, this prints a debug message */
 > }
 > 
 > int main()
 > {
 >   RDEBUG(0, "my debug message: %s", "my argument");
 > }
 
 Like I said, the ## serves no purpose (apart from maybe preventing macro
 expansion - this use of it here is no longer supported).  Just remove it.
 
 Neil.


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

end of thread, other threads:[~2001-04-01  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-01  0:00 preprocessor/2219 Neil Booth
  -- strict thread matches above, loose matches on Subject: below --
2001-04-01  0:00 preprocessor/2219 Jeremy Elson
2001-04-01  0:00 preprocessor/2219 neil
2001-04-01  0:00 preprocessor/2219 Neil Booth

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