← Back to team overview

cuneiform team mailing list archive

Re: Cuneiform Linux 0.5 is released (VS2005)

 

On Thu, 2008-11-27 at 12:16 +0200, Jussi Pakkanen wrote:
> On Wed, Nov 26, 2008 at 1:08 PM, Yury V. Zaytsev <yury@xxxxxxxxxx> wrote:
> 
> > I am not an expert on this topic, but maybe it makes more sense to use
> >
> > _CRT_NONSTDC_NO_DEPRECATE
> > _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
> >
> > instead of
> >
> > _CRT_SECURE_NO_WARNINGS
> 
> What is the difference between these two?

The security thing basically means that starting from MSVC 2005
Microsoft decided to replace standard C++ functions with their
proprietary "secure" functions which have some more checks including
buffer overflow protection etc. So ever since whenever you use standard
"unsecure" functions the compiler will issue a warning that you should
update your code to use their "secure" counterparts.

_CRT_SECURE_NO_WARNINGS just shuts the compiler up and tells him to
ignore the fact that standard functions are used (both POSIX and
"unsecure" standard functions).

_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES says to that the compiler should
overload standard functions with "secure" ones when possible and only
issue a warning when this couldn't be done automagically w/o human.

_CRT_NONSTDC_NO_DEPRECATE basically means that MSVC is not going to
issue deprecated warnings for POSIX functions which are not in the ISO
standard whenever they are used in the source code (which means that
blah() should be normally replaced with standard _blah() functions to
fix the warning).

I think that instead of shutting the compiler up, it is more sane to
tell him to leave POSIX functions alone at least for some time until the
problem is fixed (I am not sure whether those _assign() etc. are
available in GCC's C++ ? Is it possible for us to use them on *nix as
well?) and tell him to replace the "insecure" functions with "secure"
when possible automatically to take the advantage of the features which
are available on this platform. 

Hence my proposition to replace the flags... Hope it makes sense now.
 
-- 
Sincerely yours,
Yury V. Zaytsev




Follow ups

References