Bug 18818

Summary: Continuation character fails in compile stage
Product: [Retired] Red Hat Linux Reporter: Need Real Name <nilesg>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: high    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-10 14:42:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2000-10-10 14:42:56 UTC
I try to compile the following, I get a parse erorr:

#include <stdio.h>
/* the continuation character causes an error. If the chaharacter is 
removed and the following two line are joined, there is no problem */
#define PRINT (x) \
  printf(x);

main(){
  PRINT("\nHello\n");
}

Note I have created a similar file in vi so there is no CR/LF issues and 
the problem still occurs. I have a lot of source code that relies on the 
continuation character support. Please confirm this a soon as possible.
Thanks,
Gene

Comment 1 Jakub Jelinek 2000-10-10 14:54:04 UTC
Well, the code you provided above should give a parse error, because you have
space between PRINTF and (, which causes that PRINTF is not a function like
macro and the body of main expands to (x) printf(x);("\nHello\n");
If you indeed have no space between PRINTF and ( and the above is just a typo,
then make sure there are no spaces/tabs after the \ at the end of line.

Comment 2 Need Real Name 2000-10-10 15:36:59 UTC
It turns out I was a little premature in my bug report. The file I was working 
with was transferred to my pc form a NT box. When I ran vi the extra characters 
did not show up. It did however when I ran vi in binary mode.

Sorry for the inconveience.