Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Some compilers generate a warning when a pointer to an automatic variable is returned from a function, as in this example. Compile your code at high warning levels and resolve any warnings. (See guideline recommendation MSC00-C. Compile cleanly at high warning levels.)

...

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

CERT C++ Secure Coding Standard: DCL30-CPP. Declare objects with appropriate storage durations

...

Wiki Markup\[[Coverity 2007|AA. Bibliography#Coverity 07]\] \[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] Section 6.2.4, "Storage durations of objects," and Section 7.20.3, "Memory management functions" \[[

ISO/IEC PDTR 24772|AA. Bibliography#ISO/IEC PDTR 24772]\] "DCM Dangling references to stack frames"

MISRA Rule 8.6

Bibliography

Wiki Markup

\[[MISRACoverity 20042007|AA. Bibliography#MISRABibliography#Coverity 0407]\] Rule 8.6

...

      02. Declarations and Initialization (DCL)