Skip to end of metadata
Go to start of metadata

There is no content with the specified labels

Information for Editors
To have a new guideline automatically listed above be sure to label it env and recommendation.

Risk Assessment Summary

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

ENV00-CPP

low

unlikely

medium

P2

L3

ENV01-CPP

high

likely

high

P9

L2

ENV02-CPP

high

probable

medium

P12

L1

 


Rules vs. Recomendations

This coding standard consists of rules and recommendations, collectively referred to as guidelines. Rules are meant to provide normative requirements for code, whereas recommendations are meant to provide guidance that, when followed, should improve the safety, reliability, and security of software systems. Learn more about the differences.

 

1 Comment

  1. In the first section, you say "the pointer is set to a variable of smaller scope than the pointer, and the variable then goes out of scope"

    It would be more correct to say:

    "the pointer is set to point at a variable" or "the pointer is set to the address of a variable" or somesuch.

    I understand the point you're making and you may think that I'm being a little picky here, but my justification is that when we say "the pointer is set to a variable", then the variable must by definition have pointer type. This doesn't result in a dangling pointer if the "pointee" is still be in scope:

    {
     int i1=1;
     int \*p1 = NULL;
     {
      int \*p2 = &i1;
      p1 = p2;   /\\* Pointer is \_set to a variable\\_ \*/
      }
      /\\* No scope issue here as pointee 'i1' is still in scope \*/
    }