[Issue 23870] ImportC doesn't accept '\' followed by newline, whereas VC does

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 1 02:01:13 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23870

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> ---
This is invalid C code. The problem is the \ is followed by a space. The
backslash line splicing done by the preprocessor happens only when the \ is
followed by a newline.

*********************************************

This file is rejected by the gnu preprocessor with a warning:
---
warning: backslash and newline separated by space [enabled by default]
 void test() { \
 ^
---
and the \ is removed before the C compiler sees it.

**********************************************

The Microsoft preprocessor passes it unchanged to the output. VC then rejects
it with "error C2017: illegal escape sequence".

**********************************************

The ImportC error diagnostic appears to be correct. That leaves the question,
what is the context of this on your system? Is VC accepting it?

--


More information about the Digitalmars-d-bugs mailing list