I am genuinely curious about this. What are the arguments against it?
Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 19, 2023 Why doesn't the D compiler include the C preprocessor for importC? | ||||
---|---|---|---|---|
| ||||
January 19, 2023 Re: Why doesn't the D compiler include the C preprocessor for importC? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ki Rill | The only one that matters: licensing. Although once mature I'm sure we can simplify the situation somewhat as part of the Windows installer. |
January 19, 2023 Re: Why doesn't the D compiler include the C preprocessor for importC? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ki Rill | On Thursday, 19 January 2023 at 05:04:11 UTC, Ki Rill wrote: >I am genuinely curious about this. What are the arguments against it? The main reason is that other compilers/platforms define a huge number of macros and extensions that real header files depend on. There is already a C preprocessor written in D (https://github.com/walterbright/warp) that could be used, but there’s an endless parade of predefined macros. |
January 20, 2023 Re: Why doesn't the D compiler include the C preprocessor for importC? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dave P. | On 1/18/2023 9:49 PM, Dave P. wrote:
> On Thursday, 19 January 2023 at 05:04:11 UTC, Ki Rill wrote:
>> I am genuinely curious about this. What are the arguments against it?
>
> The main reason is that other compilers/platforms define a huge number of macros and extensions that real header files depend on. There is already a C preprocessor written in D (https://github.com/walterbright/warp) that could be used, but there’s an endless parade of predefined macros.
You're right. It's (surprisingly) not that those preprocessors implement extensions. It's that they predefine several hundred macros, many of them being dependent on various switches. The documentation on it is weak to wrong to nonexistent, so one is faced with quite a problem trying to duplicate it. And then, of course, the behavior will change on the next release.
It's like chasing a rainbow.
|
Copyright © 1999-2021 by the D Language Foundation