Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-988

"<stdio.h>" should not be used in production code

    Details

    • Default Severity:
      Critical
    • Impact:
      High
    • Likelihood:
      Low
    • Legacy Key:
      PPIncludeStdio
    • Covered Languages:
      C, C++, Objective-C
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      4h
    • MISRA C 2004:
      20.9
    • MISRA C 2012:
      21.6
    • MISRA C++ 2008:
      27-0-1

      Description

      This includes file and I/O functions fgetpos, fopen, ftell, gets, perror, remove, rename and ungetc.

      Streams and file I/O have a large number of unspecified, undefined and implementation-defined behaviors associated with them. It is assumed within MISRA C that they will not normally be needed in production code in embedded systems.

      If any of the features of stdio.h need to be used in production code, then the issues associated with the features need to be understood.

      Noncompliant Code Example

      #include <stdio.h> /* Noncompliant */
      

      See

      • MISRA C:2004, 20.9 - The input/output library <stdio.h> shall not be used in production code.
      • MISRA C++:2008, 27-0-1 - The stream input/output library <cstdio> shall not be used.
      • MISRA C:2012, 21.6 - The Standard Library input/output functions shall not be used

        Attachments

          Issue Links

          1.
          C-Family RSPEC-4369 Language-Specification Active Unassigned

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Anonymous
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: