Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mark as Obsolete

Tags:

c++

obsolete

I am trying to find all the unused methods of my project. I have search ways of doing this, but the most convincing answer I found was to declare all my functions as obsolete, and remove this attribute until I got no warnings.

The problem is that I don't know how to declare a function as obsolete. When I write:

   [Obsolete]
   class Vector3{

   };

VS2005 tells me that Obsolete does not exist. Any suggestions?

like image 654
Sara Avatar asked Jul 07 '10 15:07

Sara


2 Answers

In gcc you use __attribute__ ((deprecated)) to tag functions as deprecated.

It looks like __declspec(deprecated) may do the trick in VS. You'll also have to enable warning level 1 for it to result in a diagnostic.

See http://msdn.microsoft.com/en-us/library/044swk7y%28VS.80%29.aspx

like image 166
Mark B Avatar answered Sep 29 '22 21:09

Mark B


I don't know the rest of your source code, but you should have a

using System;

at the top.

like image 44
Carvellis Avatar answered Sep 29 '22 22:09

Carvellis