From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9888 invoked by alias); 24 Apr 2003 07:46:18 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 9880 invoked from network); 24 Apr 2003 07:46:17 -0000 Received: from unknown (HELO hindon.hss.co.in) (202.54.26.202) by sources.redhat.com with SMTP; 24 Apr 2003 07:46:17 -0000 Received: from hindon.hss.co.in (localhost [127.0.0.1]) by hindon.hss.co.in (8.10.0/8.10.0) with ESMTP id h3O7iBm00700 for ; Thu, 24 Apr 2003 13:14:11 +0530 (IST) Received: from ultra.hss.co.in (ultra [192.168.100.5]) by hindon.hss.co.in (8.10.0/8.10.0) with ESMTP id h3O7i6900691; Thu, 24 Apr 2003 13:14:06 +0530 (IST) Received: from sandesh.hss.hns.com (localhost [127.0.0.1]) by ultra.hss.co.in (8.10.0/8.10.0) with ESMTP id h3O7l9t14202; Thu, 24 Apr 2003 13:17:09 +0530 (IST) Sensitivity: Subject: Re: pasting "." and "something" does not give a valid preprocessing token.. To: LLeweLLyn Reese Cc: gcc-help@gcc.gnu.org From: mskhan@hss.hns.com Date: Thu, 24 Apr 2003 07:46:00 -0000 Message-ID: MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-SW-Source: 2003-04/txt/msg00214.txt.bz2 Hi Reese, Thanks a lot for your reply. I have done as you had suggested. However it has now started giving Parse Error wherever the macro is being called. The description of the error is as follows:: UIAProc.cpp: In member function `virtual void UIAProc::UDPEventHandler(void*, int, const char*, int)': UIAProc.cpp:275: parse error before `)' token expecting o hear from you asap thanks- Sanjay LLeweLLyn Reese on 04/24/2003 12:07:55 PM To: Mohammed Sanjay Khan/HSS@HSS cc: gcc-help@gcc.gnu.org Subject: Re: pasting "." and "something" does not give a valid preprocessing token.. mskhan@hss.hns.com writes: > I've just installed gcc 3.2 and I get the warning from the subject line when > compiling code that worked just fine with 2.95.3. Can anyone tell me what the > warning means and how it can be rectified. > > The offending code is a macro : > > #define EMUL_TRACE(level, format, args...) proc::theTrace->logTrace((level, ##format , ##args) I think you do not want the token pasting ## before format or args. #define EMUL_TRACE(level, format, args...) proc::theTrace->logTrace((level, format , args) should do the trick. The token-pasting operator is only for making tokens - 'foo##bar' becomes the single token 'foobar' and its result must always produce a single valid token (or the results are undefined). Your examples would have pasted a comma onto the begining of a multichar token, and , is only a valid token by itself. > > > where "Proc" is a class defined as > > class Proc > { > > . .......... > > static TraceLog * theTrace; > > } > > and TraceLog is another class defined as > > class TraceLog > { > ............. > public: > ............ > void logTrace(int severity, char* stringToBeLogged, ...) > { > ...... > } > ............. > > } > [snip]