From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Korn To: 'Puneet Singhal' , Dhanabal Ekambaram , gcc-help@gcc.gnu.org Subject: RE: problem with macro expansion in GCC Date: Tue, 06 Feb 2001 10:15:00 -0000 Message-id: <718D38CAB6E0D011B2C90060970C28A5642677@EXCHANGESERVER> X-SW-Source: 2001-02/msg00039.html What happens if you try #define XXX(N) N ## .ptr or perhaps #define CAT(a, b) a ## b #define XXX(N) CAT(N, .ptr) One or other of those should work. You can't ask macros to concatenate two strings just by writing them next to each other, you have to use the pre-processor pasting command ##. DaveK -- we are not seats or eyeballs or end users or consumers. we are human beings - and our reach exceeds your grasp. deal with it. - cluetrain.org >-----Original Message----- >From: Puneet Singhal [ mailto:puneet@opussoft.com ] >Sent: 06 February 2001 04:54 >To: Dhanabal Ekambaram; gcc-help@gcc.gnu.org >Subject: RE: problem with macro expansion in GCC >Importance: High > > >I tried it on my machine (solaris sparc 7 and gcc 2.95.2) >I get " y .ptr" instead of desirable "y.ptr". > >Even I cant figure out why? > >Puneet > >>-----Original Message----- >>From: gcc-help-owner@gcc.gnu.org [ mailto:gcc-help-owner@gcc.gnu.org]On >>Behalf Of Dhanabal Ekambaram >>Sent: Tuesday, February 06, 2001 8:36 AM >>To: 'gcc-help@gcc.gnu.org' >>Subject: problem with macro expansion in GCC >> >> >>Hi, >> >>When I use >> >>#define XXX(N) N.ptr >> >>XXX(y) gets transformed to " y.ptr" instead of "y.ptr". >>I am not sure why i am getting this leading space in the >expanded string. >> >>Can anybody help me to eliminate this problem? >> >>Thanks, >>dhanabal > > ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************