Warning |
Command line switch |
Description |
C4146 |
/we4146 |
A unary minus operator was applied to an unsigned type, resulting in an unsigned result |
C4308 |
/we4308 |
A negative integral constant converted to unsigned type, resulting in a possibly meaningless result |
C4532 |
/we4532 |
Use of “continue”, “break” or “goto” keywords in a __finally/finally block has undefined behavior during abnormal termination |
C4533 |
/we4533 |
Code initializing a variable will not be executed |
C4700 |
/we4700 |
Use of an uninitialized local variable |
C4789 |
/we4789 |
Buffer overrun when specific C run-time (CRT) functions are used |
C4995 |
/we4995 |
Use of a function marked with pragma deprecated |
C4996 |
/we4996 |
Use of a function marked as deprecated |
一个开发人员如想以选择大部分的/ SDL的功能,但排除一个给定的警告编号(假设为例C4146)然后这可以通过在/ WD开关以禁用彗星/彗星++下,具体警告实现 - >命令行 - >附加选项在Visual Studio的用户界面:
strict_gs_check pragma是适用于所有的C/ C + +代码编译/ SDL。这指示编译器将考虑作为潜在的堆栈缓冲区溢出保护候选人更多的功能。 Visual Studio 2010中引入的GS优化得到了提高strict_gs_check一起更好地工作,特别是使许多额外的安全检查从strict_gs_check被证明是不必要的和删除。
附加/ SDL代码生成功能,将在以后的职位更详细的覆盖。
Microsoft强烈建议使用/ GS开关,因为在以往的Visual Studio版本,在Visual Studio11新/ SDL开关提供更大的保障覆盖面的机会,期间和之后发展:停留在特定的安全利益,使用/ GS的更多细节调整在Visual Studio11和/ SDL。
当然,安全性开发生命周期(SDL)是一个完整的过程和开发安全的软件,这样的方法,包括远远高于只使用特定的编译器开关 - 阅读更多查找到SDL的额外资源。