omatai
omatai

Reputation: 3728

Where is _SECURE_SCL normally found?

I'm convinced I have some std::vector bounds problems in a project built using Visual Studio 2005. According to the Microsoft documentation, I can control bounds checking using _SECURE_SCL. It assures me that it is enabled by default - courtesy of a #define _SECURE_SCL 1 somewhere. I certainly can't find it, and if I slip that definition into stdafx.h, it doesn't conflict with anything. Am I missing something? What is the "normal" way to use _SECURE_SCL?

Upvotes: 1

Views: 1242

Answers (1)

Jonathan Potter
Jonathan Potter

Reputation: 37192

By default it's defined in the header file yvals.h.

  • If both _ITERATOR_DEBUG_LEVEL and HAS_ITERATOR_DEBUGGING are undefined, HAS_ITERATOR_DEBUGGING defaults to 1 in a debug build.
  • If _SECURE_SCL is undefined, and HAS_ITERATOR_DEBUGGING is defined as 1, _SECURE_SCL defaults to 1

Different rules come into play if _ITERATOR_DEBUG_LEVEL is defined. See the header file for more information.

Upvotes: 2

Related Questions