Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-34916

qt5-qttools:remotecontrol.cpp:147: poor choice of local data type ?

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.2.1
    • 5.2.0 Beta1
    • Tools: Assistant
    • None
    • Linux
    • 75ff4069a664117a5301814f7e831c262bb6b3e3

    Description

      I just ran the static analyser "cppcheck" over the source code
      of qttools-opensource-src-5.2.0-beta1

      It said

      [remotecontrol.cpp:147]: (warning) Storing getc() return value in char variable and then comparing with EOF.

      Source code is

      while (true) {
      char c = getc(stdin);
      if (c == EOF || c == '\0')
      break;

      The test for c against EOF will always fail. Suggest change
      data type of c from char to int.

      Attachments

        For Gerrit Dashboard: QTBUG-34916
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            dcb David Binderman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes