Is importC ready?

Dave P. dave287091 at gmail.com
Fri Nov 12 05:54:42 UTC 2021


On Friday, 12 November 2021 at 04:13:44 UTC, Steven Schveighoffer 
wrote:
> On 11/11/21 10:29 PM, Walter Bright wrote:
>> On 11/11/2021 8:58 AM, bachmeier wrote:
>>> [...]
>> 
>> Was the file/line number given for the error incorrect?
>
> While you are thinking about this, one thing I brought up in 
> [another 
> thread](https://forum.dlang.org/post/smdtv6$1rjc$1@digitalmars.com), is that the preprocessor automatically adds file/line information to the preprocessed file. That is important so you can trace the error back to the original file.
>
> But for this purpose, you do have a preprocessed file, which 
> may have code that either ImportC cannot deal with or where the 
> preprocessed file seemingly has been badly formed. Having to 
> find the real line to diagnose in the real file is not that 
> easy when the error messages are all based on the file/line 
> rewrite tokens.
>
> It would be nice for the compiler to at least have an option to 
> show "true" file/line numbers. Maybe a directive to ignore all 
> file/line rewrite tokens.
>
> -Steve

Invoke gcc (or clang) with the `-P` flag. It will disable 
linemarker output, which means you’ll get error messages 
corresponding to the preprocessed line instead of the original 
line.


More information about the Digitalmars-d mailing list