/unsafe, any negative side effects?

  • Thread starter Thread starter John Paulsson
  • Start date Start date
J

John Paulsson

Hi,
If we assume that the code inside my unsafe blocks are OK and don't do
anything wrong (like screwing up memory blocks, leeks memory whatever)..

...can there be any negative side effects when re-compiling my old
application using the /unsafe compiler switch which may cause bugs? I
know it shouldn't in theory, just need to make sure my old application
won't become unstable after a /unsafe recompilation.
 
/unsafe switch by itself won't make your application unstable.
It just allows you to add some code which might make your application
unstable if you use it incorrectly.
If you do not use, say, pointers, there's no... hmm... point to use
/unsafe switch.
I'd say if you can compile without /unsafe, you should compile without it.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
Hey,
I just added some coded to my app that requires unsafe mode, just wanted
to be sure I don't screw up the rest of the app using the switch. But I
guess I/it should be safe then. Thanks!
 
You can use the unsafe keyword in C# to localize the effect. That would be
the recommended approach rather than wholesale application with a compiler
switch.
 
I thought use of the unsafe keyword in C# itself requires the
application to be compiled with /unsafe compiler switch?
 
Back
Top