digitalmars.D - [SAOC 2025] Improve importC Weekly Update #2
- Emmanuel (20/20) Sep 29 Hi everyone,
- jmh530 (2/7) Sep 29 Thanks. Do you know if the test suite includes C projects?
- Emmanuel (6/15) Sep 29 Yes, I think. there are C files being run by DMD in compilable
- Richard (Rikki) Andrew Cattermole (9/27) Sep 29 Projects like sljit. We do this with D projects using the buildkite CI
Hi everyone, This week, I had a long run with issue 20092 working to make compound literals fully work in importC and it has been successfully fixed and merged. issue: https://github.com/dlang/dmd/issues/20092 The whole idea as discussed with my mentor was to create a temporary variable and then export it with the addressof operator during semantic analysis. I did a lot of research into the expression semantics to fully understand how the compound literals would fit together. for local pointers, creating a temporary and making sure the variable declaration and the variable expression were exported with the `addressof` was enough. for globals, it needed a little extra tinkering by making sure I push the symbol into the symbol table for the address to be picked up by the pointer. PR : https://github.com/dlang/dmd/pull/21908#event-19961166923 `int *p = &(int){0};` in importC should get you a valid pointer which you can work with and not necessarily creating an object before pointing it as defined by the C standard.
Sep 29
On Monday, 29 September 2025 at 08:51:00 UTC, Emmanuel wrote:Hi everyone, This week, I had a long run with issue 20092 working to make compound literals fully work in importC and it has been successfully fixed and merged. [...]Thanks. Do you know if the test suite includes C projects?
Sep 29
On Monday, 29 September 2025 at 12:51:59 UTC, jmh530 wrote:On Monday, 29 September 2025 at 08:51:00 UTC, Emmanuel wrote:Yes, I think. there are C files being run by DMD in compilable and runnable tests. even in fail compilations as well. I don't really get what you mean by `C projects` but C files are being tested.Hi everyone, This week, I had a long run with issue 20092 working to make compound literals fully work in importC and it has been successfully fixed and merged. [...]Thanks. Do you know if the test suite includes C projects?
Sep 29
On 30/09/2025 2:23 AM, Emmanuel wrote:On Monday, 29 September 2025 at 12:51:59 UTC, jmh530 wrote:Projects like sljit. We do this with D projects using the buildkite CI test. But not with C. This is one of the libraries I consider a requirement for ImportC to be minimally operational. https://github.com/dlang/dmd/issues/21891 https://github.com/dlang/dmd/issues/21890 ImportC is getting really close, but yes it would be nice if we could track this with actual C projects being tested against.On Monday, 29 September 2025 at 08:51:00 UTC, Emmanuel wrote:Yes, I think. there are C files being run by DMD in compilable and runnable tests. even in fail compilations as well. I don't really get what you mean by `C projects` but C files are being tested.Hi everyone, This week, I had a long run with issue 20092 working to make compound literals fully work in importC and it has been successfully fixed and merged. [...]Thanks. Do you know if the test suite includes C projects?
Sep 29