Uploaded image for project: 'SonarCFamily'
  1. SonarCFamily
  2. CPP-1472

Improve utilization of Pre-Parsed-Headers

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.12
    • Component/s: Parser
    • Labels:
      None

      Description

      1.c
      #include "guarded.h"
      #include "another.h"
      
      2.c
      #include "another.h"
      #include "guarded.h"
      
      guarded.h
      #ifndef GUARD
      #define GUARD
      int guarded;
      #endif
      
      another.h
      int chunk1;
      
      #include "guarded.h" // tokens of "guarded.h" would be included in list of tokens for "another.h", because of declaration above
      // as a consequence of this and of presence of include-guard in "guarded.h"
      // two different lists of tokens would be observed for this file depending on the order of include-directives in files "1.c" and "2.c"
      // and hence this file will not reuse previously generated PPH,
      // so that same issues might be reported multiple times in this header
      
      int chunk2;
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              evgeny.mandrikov Evgeny Mandrikov
              Reporter:
              evgeny.mandrikov Evgeny Mandrikov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: