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

Proposed rule: avoid signed/unsigned assignments changing the sign

    XMLWordPrintable

    Details

      Description

      Report assignment of a negative value to an unsigned variable.
      Report assignment of a large unsigned value that gets converted to a negative signed value when assigned to a signed variable.
      Same for function arguments and return values.
      Implementation might be based on a similar rule about signed/unsigned comparison:
      S6214

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            arseniy.zaostrovnykh Arseniy Zaostrovnykh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: