Versions Compared

Key

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

...

Code Block
bgColor#FFCCCC
langc
/* In another source file */
#include <string.h>
void copy(char *dst, const char *src) {
  if (!strcpy(dst, src)) {
    /* Report error */
  }
}
 
/* In this source file --, no copy prototype in scope */
void copy();
 
void g(const char *s) {
  char buf[20];
  copy(buf, s, sizeof buf);  /* Violation */
  /* ... */
}

...