Is importC ready?
Walter Bright
newshound2 at digitalmars.com
Fri Nov 12 03:29:07 UTC 2021
On 11/11/2021 8:58 AM, bachmeier wrote:
> - The error messages tell you nothing. The only solution is to go through the
> entire (large) preprocessed C file and identify every problem, with no help from
> the compiler. The error message that caused me to file the bug was `illegal
> combination of type specifiers`. After more than an hour of working on it, I had
> finally commented out enough lines to make the error messages go away.
Was the file/line number given for the error incorrect?
I agree, though, that the error messages are inadequate. This first iteration of
ImportC has a priority of getting correct code to compile correctly. Error
messages are admittedly mostly placeholders. The important thing is the
file/line being correct.
> - It's not obvious to someone lacking a strong understanding of C compilers how
> to make the correct adjustments to the code. For instance, what am I supposed to
> do with `_Float128` to get something that runs *and* is guaranteed to no change
> the behavior of the code? I've never written a line of C code that used a
> compiler extension in my life. It would require a major investment on my part.
I don't know what _Float128 is, either (though I can guess). So I turn to Google:
https://www.google.com/search?q=C+_Float128
And the first hit is:
https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
Most of the C headers are declarations. If you just comment out the offending
declarations, the code will likely compile just fine, since you likely wouldn't
be using _Float128 unless you knew what it was.
More information about the Digitalmars-d
mailing list