[Issue 23693] ImportC: Unclear documentation of #line and linemarker support

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Dec 5 10:30:45 UTC 2023


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

--- Comment #5 from Iain Buclaw <ibuclaw at gdcproject.org> ---
(In reply to Walter Bright from comment #4)
> There are two different things:
> 
> 1. #line directives described as part of the preprocessing pass, in C11
> 6.10.4. They were asked for for D, and I didn't see an issue with leaving
> them in for C.
> 
> 2. linemarkers
> 
> The linemarker tests:
> 
>     # 1020 "cstuff3.c" 1 2 3 4
> 
> conform to gcc's specification of them:
> 
> "After the file name comes zero or more flags, which are ‘1’, ‘2’, ‘3’, or
> ‘4’. If there are multiple flags, spaces separate them."
> 
> https://gcc.gnu.org/onlinedocs/gcc-11.1.0/cpp/Preprocessor-Output.html
> 
> gcc does indeed barf on more than one flag, but that's a bug in gcc,
> according to gcc's spec.
> 
There is no spec on them.  Line markers are machine-generated code inserted
into the preprocessed source file, human-written tests don't make much sense to
be present in the testsuite unless they are the product of copying from a
compiler generated `.i` file.

--


More information about the Digitalmars-d-bugs mailing list