Airtime
  1. Airtime
  2. CC-21

compiler warning at modules/core/src/AudioClip.cxx:108

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      src/AudioClip.cxx: In member function `virtual void
      LiveSupport::Core::AudioClip::configure(const xmlpp::Element&)':
      src/AudioClip.cxx:108: warning: suggest parentheses around assignment
      used as truth value

        Activity

        Hide
        Andrey Podshivalov
        added a comment -
        It protesteth too much. What it wants me to do is to change if (x
        = someMethod()) { ... } to if ((x = someMethod())) { ... } Do
        you really want me to change that?
        OK, I put the extra parentheses in. My idea of clarity seems to
        differ from gcc's, though.
        the extra parenthesis here is to clearly mark your intent. compare
        if (x = someMethod()) { ... } with if (x == someMethod()) { ...
        } it's a very easy and common mistake to mistype == to =, and thus
        change the effect of the code totally. with the extra parenthesis you
        clearly mark that what you mean is an assignment, not a comparison.
        Show
        Andrey Podshivalov
        added a comment - It protesteth too much. What it wants me to do is to change if (x = someMethod()) { ... } to if ((x = someMethod())) { ... } Do you really want me to change that? OK, I put the extra parentheses in. My idea of clarity seems to differ from gcc's, though. the extra parenthesis here is to clearly mark your intent. compare if (x = someMethod()) { ... } with if (x == someMethod()) { ... } it's a very easy and common mistake to mistype == to =, and thus change the effect of the code totally. with the extra parenthesis you clearly mark that what you mean is an assignment, not a comparison.
        Paul
        made changes -
        Field Original Value New Value
        Workflow jira [ 12148 ] Software Dev Workflow [ 14441 ]
        Paul
        made changes -
        Workflow Software Dev Workflow [ 14441 ] Software Dev Workflow 2 [ 18130 ]

          People

          • Assignee:
            fgerlits
            Reporter:
            maroy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: