C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 16th, 2003, 08:48 PM
Jack Z Jack Z is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: CA
Posts: 1 Jack Z User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question gcc2.95.3 eliminate white space at the end of line

Hi Folks,
I have following questions need your help. I need to tweak gcc 2.95.3. For GCC 2.95.3, when the compiler see a white space after the line continuation character '\' it will give me errors. GCC3 this will give an warning. I need to implement the same functionality in GCC2.95.3.
Following is the code: (There is an whitespace at the end of '\'
----------------
#define max(a,b) (a>b)? \
a:b
int main()
{
return 1;
}
----------------
GCC2.95.3 complains:

line.c:4: parse error before `>'
line.c:14: stray '\' in program
line.c:14: parse error before `;'

GCC3.0 give warnings,but still compiles.
line.c:3:14: warning: backslash and newline separated by space

I think the following would be the approach:
(1) use perl to pre process the .h/.c file.
This will slow down the compiling speed. So it not recommendated.
(2) tweak the pre-processor c-syntax file such as c-parse.c/clex.c to allow white space at the end of line continuation character.
I think this is a better way. But I can not locate the place to add
this rule in the c syntax file. Generally speaking the Flex program will use the .l file to define language syntax, but I can not find any file with extension 'l'. Is the syntax file defined in c-parse.y? Where can I add this rule to let gcc eat the extra whitespaces ?


Could you please help me ?
Thanks a lot.

-Jack Zhang

Last edited by Jack Z : June 17th, 2003 at 06:41 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > eliminate white space at the end of line


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway