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

S856: False positive when typedefs and aliases to void* are used

    XMLWordPrintable

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.24
    • Fix Version/s: 6.26
    • Component/s: Rules
    • Labels:

      Description

      using vptr = void *;
      int func(vptr ptr);
      int main()
      {
          int a = 1;
          func(static_cast<void*>(&a)); // No violation, as expected
          func(static_cast<vptr>(&a)); // Violation, false positive
      }
      

        Attachments

          Activity

            People

            Assignee:
            loic.joly Loïc Joly
            Reporter:
            loic.joly Loïc Joly
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: