public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* prob in compilation with gcc3.4
@ 2005-05-18  4:17 Deepak Soi
  2005-05-18  4:22 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Deepak Soi @ 2005-05-18  4:17 UTC (permalink / raw)
  To: gcc-help

Hi,
       I am getting a compilation error with gcc3.4. Is there some 
special handling of macros in gcc3.4 as all these lines are calling 
macros . It will be really nice if somebody helps out, I am struck.
==============================================================
  find.cxx:723:1: pasting "DbNet" and "*" does not give a valid 
preprocessing token.
  find.cxx:723:1: pasting "Net" and "*" does not give a valid 
preprocessing token.
  find.cxx:723:1: pasting "FindFromDbNet" and "(" does not give a valid 
preprocessing token.
==================================================================

regards
Deepak





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

* Re: prob in compilation with gcc3.4
  2005-05-18  4:17 prob in compilation with gcc3.4 Deepak Soi
@ 2005-05-18  4:22 ` Ian Lance Taylor
  2005-05-18  7:10   ` problem with pasting two tokens together in gcc 3.4 Deepak Soi
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2005-05-18  4:22 UTC (permalink / raw)
  To: sdeepak; +Cc: gcc-help

Deepak Soi <sdeepak@cadence.com> writes:

>        I am getting a compilation error with gcc3.4. Is there some
> special handling of macros in gcc3.4 as all these lines are calling
> macros . It will be really nice if somebody helps out, I am struck.
> ==============================================================
>   find.cxx:723:1: pasting "DbNet" and "*" does not give a valid
> preprocessing token.
>   find.cxx:723:1: pasting "Net" and "*" does not give a valid
> preprocessing token.
>   find.cxx:723:1: pasting "FindFromDbNet" and "(" does not give a
> valid preprocessing token.
> ==================================================================

Sounds like invalid use of ##, which is used to paste two tokens
together into a single token.  The problem is going to be somewhere
inside your macro definitions.  Perhaps you are simply using an
inappropriate argument to your macro.  It's impossible to say much
more without an example.

Ian

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

* problem with pasting two tokens together in gcc 3.4
  2005-05-18  4:22 ` Ian Lance Taylor
@ 2005-05-18  7:10   ` Deepak Soi
  2005-05-18 10:44     ` Arturas Moskvinas
  2005-05-18 15:06     ` Nix
  0 siblings, 2 replies; 5+ messages in thread
From: Deepak Soi @ 2005-05-18  7:10 UTC (permalink / raw)
  To: gcc-help

Hi,       
       Yes, you are right problem we are facing is with pasting two 
tokens together, but what I am unable to understand is why its compiling 
properly with older gcc versions. Is there any change in gcc3.4 handling 
of macros.I will be thankful for your help on this.

======================================================================
Error

 find.cxx:723:1: pasting "DbNet" and "*" does not give a valid 
preprocessing token.

  find.cxx:723:1: pasting "Net" and "*" does not give a valid
preprocessing token.
  find.cxx:723:1: pasting "FindFromDbNet" and "(" does not give a
valid preprocessing token.

=====================================================================

regards
Deepak Soi




Ian Lance Taylor wrote:

>Deepak Soi <sdeepak@cadence.com> writes:
>
>  
>
>>       I am getting a compilation error with gcc3.4. Is there some
>>special handling of macros in gcc3.4 as all these lines are calling
>>macros . It will be really nice if somebody helps out, I am struck.
>>==============================================================
>>  find.cxx:723:1: pasting "DbNet" and "*" does not give a valid
>>preprocessing token.
>>  find.cxx:723:1: pasting "Net" and "*" does not give a valid
>>preprocessing token.
>>  find.cxx:723:1: pasting "FindFromDbNet" and "(" does not give a
>>valid preprocessing token.
>>==================================================================
>>    
>>
>
>Sounds like invalid use of ##, which is used to paste two tokens
>together into a single token.  The problem is going to be somewhere
>inside your macro definitions.  Perhaps you are simply using an
>inappropriate argument to your macro.  It's impossible to say much
>more without an example.
>
>Ian
>  
>



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

* Re: problem with pasting two tokens together in gcc 3.4
  2005-05-18  7:10   ` problem with pasting two tokens together in gcc 3.4 Deepak Soi
@ 2005-05-18 10:44     ` Arturas Moskvinas
  2005-05-18 15:06     ` Nix
  1 sibling, 0 replies; 5+ messages in thread
From: Arturas Moskvinas @ 2005-05-18 10:44 UTC (permalink / raw)
  To: sdeepak; +Cc: gcc-help

>        Yes, you are right problem we are facing is with pasting two
> tokens together, but what I am unable to understand is why its compiling
> properly with older gcc versions. Is there any change in gcc3.4 handling
> of macros.I will be thankful for your help on this.

You could write the version where this "kind" of thing worked, then it
would be easier to answer to your question.

Arturas Moskvinas

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

* Re: problem with pasting two tokens together in gcc 3.4
  2005-05-18  7:10   ` problem with pasting two tokens together in gcc 3.4 Deepak Soi
  2005-05-18 10:44     ` Arturas Moskvinas
@ 2005-05-18 15:06     ` Nix
  1 sibling, 0 replies; 5+ messages in thread
From: Nix @ 2005-05-18 15:06 UTC (permalink / raw)
  To: sdeepak; +Cc: gcc-help

On 18 May 2005, Deepak Soi moaned:
> Hi, Yes, you are right problem we are facing is with pasting two
> tokens together,

You shouldn't use ## to paste two tokens together if there result would
be parsed as two tokens (as is the case below). Its purpose is to paste
two tokens together to yield *one* token. That is,

#define IdentifierComposition (x, y) x##y
IdentifierComposition(Some,Function)

would yield the *single token* `SomeFunction'.

>                  but what I am unable to understand is why its
> compiling properly with older gcc versions. Is there any change in
> gcc3.4 handling of macros.

The preprocessor was rewritten completely before GCC 3.0, and has got
progressively stricter (i.e. more standards-compliant) since then.
I believe even GCC-3.0 complained about this (erroneous) construct,
but I'm not certain.

>  find.cxx:723:1: pasting "DbNet" and "*" does not give a valid preprocessing token.
>   find.cxx:723:1: pasting "Net" and "*" does not give a valid
> preprocessing token.
>   find.cxx:723:1: pasting "FindFromDbNet" and "(" does not give a
> valid preprocessing token.

You shouldn't be using ## in any of those cases. Exactly how your macros
should be restructured depends on what the macros are doing, but probably
you can replace a##b with a simple `a b'.

-- 
`End users are just test loads for verifying that the system works, kind of
 like resistors in an electrical circuit.' - Kaz Kylheku in c.o.l.d.s

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

end of thread, other threads:[~2005-05-18 15:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-18  4:17 prob in compilation with gcc3.4 Deepak Soi
2005-05-18  4:22 ` Ian Lance Taylor
2005-05-18  7:10   ` problem with pasting two tokens together in gcc 3.4 Deepak Soi
2005-05-18 10:44     ` Arturas Moskvinas
2005-05-18 15:06     ` Nix

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