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

S995, S1172: Ignore exported API functions

    Details

      Description

      Some functions might be explicitly marked as parts of the external interface of a module. Likely, the developer has no control over the signature of such functions. RSPEC-995 and RSPEC-1172 rules should therefore ignore functions marked as such. The common annotations are _attribute((visibility("default"))) for GCC and _declspec(dllexport) for msvc:

      __attribute__((visibility("default")))
      int foo(int* x, int* y) {
        return *x;
      }
      
      __declspec(dllexport)
      int bar(int* x, int* y) {
        return *x;
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                geoffray.adde Geoffray Adde
                Reporter:
                arseniy.zaostrovnykh Arseniy Zaostrovnykh
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: