Skip to main content

IAR Embedded Workbench for RH850 3.20.x

MISRAC2012-Rule-1.5_e

In this section:
Synopsis

(Required) Obsolescent language features shall not be used.

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

The gets function is obsolescent, and is deprecated.

Coding standards
MISRA C:2012 Rule-1.5

(Required) Obsolescent language features shall not be used.

Code examples

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

#include <stdio.h>

void example(void) 
{
   char str[50];
   gets(str);
}

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


void example(void) {;}