[Issue 23693] compilable/testcstuff3.i:7:1: error: stray '#' in program

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 20 10:52:51 UTC 2023


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

--- Comment #3 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Walter Bright from comment #2)
> ImportC has to work with the output of C preprocessors other than gcc's.
> There's not much I can do about that. I recommend gcc simply not run those
> tests.
The point of this is to find code that is not valid C. Be it because the
standard says it's not supported, or it's a vendor-specific extension of C that
we're testing in the wrong way. After all if they reject the way we're testing
their own extensions, maybe we should reject them too.

The ImportC documentation is pretty scant on actually saying what is accepted.

https://dlang.org/spec/importc.html#preprocessor-directives

Perhaps obvious enough to close this as wontfix (though I'd prefer to fix the
GCC linemarker tests so they are *valid* examples of lines the preprocessor
will pipe to ImportC).  But not obvious enough that they are accepted even if
there's been no preprocessing done on the input file.  Maybe a couple examples
of what forms of #line directive and linemarker are supported - same as the
#pragma paragraph.

--


More information about the Digitalmars-d-bugs mailing list