none
Partial unsafe application. RRS feed

  • Question

  •  

    I have some functions that I want to use the unsafe{} block with and all others I would like not to be "unsafe". As I see it now the only way to have unsafe blocks is to compile with /unsafe. But that makes it "legal" to use unsafe code throughout the whole app. Is there a way to mark certain functions as "unsafe" to avoid using the compiler flag /unsafe? I know I could put all of the unsafe code in a separate assembly but if I could I would like to avoid that.

     

    Thank you.

     

    Kevin

    Sunday, March 16, 2008 1:26 AM

Answers

  • In order for C# to compile unsafe code, the application must be compiled with /unsafe. This is the only way.

    And you have to put all of the unsafe code in a separate assembly.

    Monday, March 17, 2008 6:39 AM