Versions Compared

Key

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

...

This example can be corrected many different ways depending on the intent of the programmer. In this compliant solution, p2 is found to be extraneous. The calls to bar() and baz() can be removed if they do not produce any side - effects.

Code Block
bgColor#ccccff
int *p1 = foo();

/* Removable if bar() does not produce any side- effects */
bar(); 

/* Removable if baz() does not produce any side- effects */
baz(); 
return p1;

Risk Assessment

...