www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22248] New: ImportC: Specify C compiler when multiple options

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

          Issue ID: 22248
           Summary: ImportC: Specify C compiler when multiple options are
                    available
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC, spec
          Severity: enhancement
          Priority: P1
         Component: dlang.org
          Assignee: nobody puremagic.com
          Reporter: schveiguy gmail.com

For instance, on Linux, dmd can link with code built with both gcc and clang
(and likely others). If D will compile C code, and there may be differences
between the various compilers (e.g. bitfield handling), the ImportC compiler
should select a default compiler for that platform.

Obviously, ldc should match llvm, and gdc should match gcc. But DMD doesn't
always have an equivalent C compiler.

Optionally, it may be useful (if all the code is going to be inside the front
end anyway) to specify an expected compatible compiler.

--
Aug 28 2021