[Issue 19195] New: Support pragma to specify linker directives

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 27 02:05:11 UTC 2018


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

          Issue ID: 19195
           Summary: Support pragma to specify linker directives
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: turkeyman at gmail.com

MSVC emits a bunch of "/FAILIFMISMATCH:" directives to object files.
These express the state of various conditions during compilation, and guard
against incorrect linking.

Please add a pragma to emit these to object files in the same way as
pragma(lib, ) does for the "/DEFAULTLIB:" directive.

Perhaps a general `pragma(linkdirective, "text")` could be added to support raw
directives as required, and future-proof against this class of problem.


For example:
  pragma(linkdirective, "/FAILIFMISMATCH:_ITERATOR_DEBUG_LEVEL=2");

May appear in a source file under a version() where struct's are specified
accordingly to match such configuration of the MSCRT.

--


More information about the Digitalmars-d-bugs mailing list