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

Non-standard characters should not occur in header file names in "#include" directives

    Details

    • Type: Bug Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way
    • Legacy Key:
      PPIncludeNonStandardCharacters
    • Covered Languages:
      C, C++, Objective-C
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      10min
    • MISRA C 2004:
      19.2
    • MISRA C 2012:
      20.2
    • MISRA C++ 2008:
      16-2-4, 16-2-5
    • PC-Lint:
      9020

      Description

      If the ', }}, {{" or / characters are used between < and > delimiters or the ', }} or {{/ characters are used between the " delimiters in a header name preprocessing token, then the behavior is undefined.

      Noncompliant Code Example

      #include <"foo">     // Noncompliant
      #include "dir\foo.h" // Noncompliant
      

      See

      • MISRA C:2004, 19.2 - Non-standard characters should not occur in header file names in #include directives.
      • MISRA C++:2008, 16-2-4 - The ', ", /* or // characters shall not occur in a header file name.
      • MISRA C++:2008, 16-2-5 - The \ character should not occur in a header file name.
      • MISRA C:2012, 20.2 - The ', " or \ characters and the /* or // character sequences shall not occur in a header file name

        Attachments

          Issue Links

          1.
          C-Family RSPEC-4363 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: