![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error when compile httpd 2.2.8 on AIX 5.2 | aldowsary | AIX | 7 | 02-13-2008 06:21 PM |
| C compile error | kuampang | High Level Programming | 3 | 11-30-2006 12:30 AM |
| compile error message | putput | High Level Programming | 4 | 10-04-2006 04:43 AM |
| Compile error | coulio | High Level Programming | 9 | 06-30-2006 05:43 AM |
| compile error while using dlopen | shriashishpatil | High Level Programming | 5 | 06-29-2006 03:01 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi all,
I compile my c program and get following result hrnpfc01.c:1387: stray '\' in program hrnpfc01.c:1387: parse error before `,' hrnpfc01.c:1388: stray '\' in program hrnpfc01.c:1388: parse error before `,' hrnpfc01.c:1396: stray '\' in program hrnpfc01.c:1396: parse error before `,' And the code segments are #define HRNPC_REPORT_REC_FORMAT_1 \ "Transaction Date : %s" #define HRNPC_ERROR_REPORT_REC_LINE_2 \ "Staff No. Error Message" I search old post and someone mention that the problme is due to a space after "\" But I ensure that there is no space after the "\" Actually, i compile the program on Suse 6.4 by gcc 2.95 Thanks, Zico |
|
||||
|
Sorry for post wrong program segment
The code should be gogr_write_report_line ( HRNPC_ERROR_REPORT_REC_LINE_2, prep_des ); gogr_write_report_line ( HRNPC_ERROR_REPORT_REC_LINE_3, prep_des ); and the header files contains #define HRNPC_ERROR_REPORT_REC_LINE_2 \ "Staff No. Error Message" #define HRNPC_ERROR_REPORT_REC_LINE_3 \ "---------- ----------------------------------------------------------------- -----------------------------------------" Does the gcc complain about the comma after HRNPC_ERROR_REPORT_REC_LINE_2 and HRNPC_ERROR_REPORT_REC_LINE_3 thanks |
|
|||||
|
Yesterday you posted different #define's and you stated that you had ensured that the blackslash was immediately follwed by a newline.
What about today's #define's? Are you sure that these backslashes are immediately followed by a newline? If so, this would look like a gcc bug. But yesterday's post showed that you have at least 4 #define's in total with a blackslash but you have only 3 pairs of error messages. I suspect an error on your part involving those 3 #define's. I would expect a compiler bug to be more consistent. The "bible" states "each occurrence of a backslash character followed by a newline is deleted, thus splicing lines." I'd be surprised if gcc got this wrong. If nothing else, join the lines yourself in an editor. |
|
|||||
|
Your right, K&R's bible is not very often ignored. If you are using vi as an editor, try doing a :set list and look for special characters where your defines are. You could also do an od -c <file> and, search for your defines.
Cheers, Keith Last edited by kduffin; 11-17-2003 at 10:53 PM.. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|