Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC++2008-18-0-5

In this section:
Synopsis

(Required) The unbounded functions of library <cstring> shall not be used.

Enabled by default

Yes

Severity/Certainty

Low/Medium

lowmedium.png
Full description

Uses of strcpy, strcmp, strcat, strchr, strspn, strcspn, strpbrk, strrchr, strstr, strtok, or strlen were found.

Coding standards

This check does not correspond to any coding standard rules.

Code examples

The following code example fails the check and will give a warning:

#include <string.h>

void example(void) {
  char buf[100];
  strcpy(buf, "Hello, world!\n");
}

The following code example passes the check and will not give a warning about this issue:

void example(void) {
}