I
Igmar Palsenberg
Roman said:Hello,
I just downloaded MS Visual Studio 2005 Express Beta. When I tried to
compile existing valid project, I get a lot of warnings like 'sprintf'
has been deprecated, 'strcpy' has been deprecated etc. I opened STDIO.H
and figured that one has to define a macro _CRT_SECURE_NO_DEPRECATE
to stop these warnings.
There is more when writing insecure programs. integer overflows,
unsignedness issues, corrupted heaps, etc.
The use of strcpy() itself isn't always unsafe, it's use is unsafe when
certain conditions are met. It's a matter of just thinking before you
type the lines of C. The path that MS chooses doesn't give 100% secure
programs, it just gives a false sense that programs are more secure.
Thinks like stack protection (stackguard / propolice in gcc), or the
recent guard is MSVC are good things, but don't match up with the best
think : Simply writing good code.
I'm using valgrind at the moment, and that simply learns you to write
better code : I'm seeing a decrease in errors that leads to invalid
memory reads / writes in my own code, and you learn what actually
happens, and where in the code it happens.
That beats all runtime stuff that prevents it from happening, since it
doesn't tell you why it is happening. Tools like valgrind tell that, and
help make better programmers.
Just my 2 cents.
Igmar