This patch adds support for MSVC's #pragma detect_mismatch.  This
pragma emits a linker command into the object file which allows the
linker to ensure that there are no inconsistent object files being
linked together.  Eg)

// 1.cpp
#pragma detect_mismatch( "my_library", "1" )

// 2.cpp
#pragma detect_mismatch( "my_library", "2" )

If you link these files together with link.exe, you will get a linker
error (2038) pointing out that the values for my_library do not match.
 However, if 2.cpp had "1" in place of "2", the files would link
together without issue.

For more information, see MSDN:
http://msdn.microsoft.com/en-us/library/ee956429.aspx

The code was modeled after our existing support for passing linker
commands, and makes use of the fact that detect_mismatch uses the
/FAILIFMISMATCH linker option.

~Aaron

Attachment: detect_mismatch.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to