From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21595 invoked by alias); 1 Aug 2002 12:46:08 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 21544 invoked by uid 71); 1 Aug 2002 12:46:06 -0000 Date: Thu, 01 Aug 2002 05:46:00 -0000 Message-ID: <20020801124606.21541.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Gregory Nicholls Subject: Re: preprocessor/7457: failure preprocessing ## directive Reply-To: Gregory Nicholls X-SW-Source: 2002-08/txt/msg00001.txt.bz2 List-Id: The following reply was made to PR preprocessor/7457; it has been noted by GNATS. From: Gregory Nicholls To: neil@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, gnicholls@bluephoenixsolutions.com, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: Subject: Re: preprocessor/7457: failure preprocessing ## directive Date: Thu, 01 Aug 2002 08:36:29 -0400 --------------1234E970CAB8843E2902E53D Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit OK thanks, This was some old (10yr) code that used to work and then didn't. I wondered about the concat but confess that I'm a bit vague on the pre-processor stuff. Sorry for the trouble. G. neil@gcc.gnu.org wrote: > Synopsis: failure preprocessing ## directive > > State-Changed-From-To: open->closed > State-Changed-By: neil > State-Changed-When: Wed Jul 31 15:20:59 2002 > State-Changed-Why: > Not a bug - please understand what ## means. > > It means: "take the spelling of the LHS, and the spelling > of the RHS, and concatenate the two to form a new token. If the concatenation does not form a valid token, anything goes.". You are trying to create a token > > "libdrv"".so" > > which is not a token (it's two tokens). However, if you just drop the !@#$%^& ##, then you're OK: two strings > concatenate to become one string by the rules of C (post > macro expansion and preprocessing). > > Please read a good description of what ## does. > > Yes, GCC is getting more picky. That's a good thing. > > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7457 --------------1234E970CAB8843E2902E53D Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit   OK thanks,
        This was some old (10yr) code that used to work and then didn't. I wondered about the concat but confess that I'm a bit vague on the pre-processor stuff.
    Sorry for the trouble.
            G.

neil@gcc.gnu.org wrote:

Synopsis: failure preprocessing ## directive

State-Changed-From-To: open->closed
State-Changed-By: neil
State-Changed-When: Wed Jul 31 15:20:59 2002
State-Changed-Why:
    Not a bug - please understand what ## means.

    It means: "take the spelling of the LHS, and the spelling
    of the RHS, and concatenate the two to form a new token.  If the concatenation does not form a valid token, anything goes.".  You are trying to create a token

       "libdrv"".so"

    which is not a token (it's two tokens).  However, if you just drop the !@#$%^& ##, then you're OK: two strings
    concatenate to become one string by the rules of C (post
    macro expansion and preprocessing).

    Please read a good description of what ## does.

    Yes, GCC is getting more picky.  That's a good thing.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7457

--------------1234E970CAB8843E2902E53D--