I know .NET and Mono are binary compatible but given a set of source code, will csc and mcs produce the exact same 100% identical binary CLI executable? Would one be able to tell whether an executable was compiled with csc or mcs?
A lot of things are not fully defined in the spec, or are implementation-specific extensions.
Examples of not-fully-specified:
Expression
construction (from lambdas); is simply "defined elsewhere" (actually, it isn't)Examples of implementation extensions:
new
on an interface)So no: it is not guarantees to have the same IL, either between csc or [g]mcs - but even between different versions of csc.
Even more: depending on debug settings, optimizations being enabled or not, and some compilation constants being defined (such as DEBUG or TRACE), the same compiler will generate different code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With