I've read on stackoverflow that some C functions are 'obsolete' or should be 'avoided'. Can you please give me some examples of this kind of functions + the reason why.
What alternatives of those function exists ?
Can we use them safely - any good practices ?
Later edit:
From the answers:
gets : can cause buffer overflows.
scanf : f...
My batch build has a project, lets call it 'My.Project'. That project got up-reved to .NET 3.5 (from .NET 1.1) in its own standalone project (meaning its not part of this batch build). Most of it is the same, there are calls that were upgraded, features added/removed. I go to start replacing all calls that all the other projects use t...
Recently I've started learning about Contexts in .NET (context-bound, context-agile, message sinks, etc.). Several alarm bells started ringing:
All context-bound classes are derived from ContextBoundObject, which in turn is derieved from MarshalByRefObject. MarshalByRefObject is a part of the .NET Remoting architecture. The .NET Remot...
Hello
If have a new project (ProjNew ) where I want to put several classes that are on other project (ProjOld).
The problem is I want to maintain the old classes marked with Obsolete to avoid running all my projects and check if they using it.
But in that way this may throw a ambiguous class name error because I didn't explicitly cal...
Hi,
I'm using Visual Studio 2010. But find that the Obsolete attribute doesn't cause any compiler warning (I want it to cause a compiler warning).
The warning level is 4.
Thanks.
...
Hi,
I wonder that the obsolete attribute is checked at only runtime?
Think that you have two assemblies. Assembly A uses a method from Assembly B. After that we mark the method in Assembly B as obsolete which causes a compile time error when compiling assembly A.
No problem so far but the question is whether the older assembly A cont...
Some .net-framework interfaces and attributes become obsolete and deprecated since new framework version appears. I am warned that such code may be removed or become unpredictable in next versions but have you ever faced the situation when you were forced to refactor code because code came uncompilable or start to behave weird? What was ...
Hi!
Sometime ago I defined a class that was serialized using XML. That class contained a serializable property Alignment of integer type. Now I have extended and updated this class, whereby a new property Position was added, whose type is another class that also has several serializable properties. The new property Position is now suppos...
Hi,
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]
cl...
I was recently told it was bad practice to haved marked a number of methods in our code with the [Obsolete] attribute. These methods were internal to our codebase, rather than being on an API. The methods handled an older encryption function.
I felt it was a quick and safe way to denote to the rest of the team that these methods should ...
I would like to be able to keep a C# API the same as it is now, but simply deprecate one of the parameters in a method call. Is it possible to do so, or do I need to create a new method without the parameter and mark the original one as Obsolete?
...