This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

preprocessor/760: 'dos' format files upset cpp when using '\' to continue macros



>Number:         760
>Category:       preprocessor
>Synopsis:       'dos' format files upset cpp when using '\' to continue macros
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 09 12:16:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Tony Luck
>Release:        egcs-2.91.66 19990314/Linux
>Organization:
>Environment:
redhat linux
>Description:
I have an application that was developed on a windows system so all the files use \r\n to terminate lines. The compiler is mostly happy with this, except when a macro extends across multiple lines, then the compiler complains.
>How-To-Repeat:
here's a trivial test case ... just make sure that you end all lines with \r\n:

------------------------------------------
#define inc(x) \
        ((x) + 1)

main()
{
        printf("%d\n", inc(1));
}
-------------------------------------------

compiler says:
-------------------------------------------
test.c:2: parse error before `+'
test.c:6: stray '\' in program

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]