Search Unity

"checked" compiler option ignored

Discussion in 'Scripting' started by JAKJ, Dec 24, 2015.

  1. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    I have confirmed the compiler should support this, because running "smcs.exe" in the Unity installation lists "-checked" as an option. I have created both smcs.rsp and gmcs.rsp with "-unsafe" which works (error without "-unsafe", success with "-unsafe"), but "-unsafe -checked" does not cause integer operations to be checked, no matter what I do. If I put the code in a "checked{}" block, I do get an exception.

    Why does the compiler not respect "-checked" project-wide when it does respect "-unsafe"?