Qpid
  1. Qpid
  2. QPID-3284

Removed unused variables, which caused the build to break under GCC 4.6

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.10
    • Fix Version/s: 0.11
    • Component/s: C++ Broker
    • Labels:
      None
    • Environment:

      Fedora 15 x86_64.

      Description

      There were several variables that were declared and assigned values but whose values were not used. This caused GCC 4.6.0 to raise a warning, which causes the build to stop.

      This patch removes those unused variables.

      1. 0001-Removed-unused-variables.patch
        5 kB
        Darryl L. Pierce
      2. 0001-Removed-unused-variables.patch
        5 kB
        Darryl L. Pierce

        Activity

        Hide
        Darryl L. Pierce added a comment -

        Git patch to remove unused variables.

        Show
        Darryl L. Pierce added a comment - Git patch to remove unused variables.
        Hide
        Chuck Rolke added a comment -

        This patch appears to re-install warnings for other users. Specifically:

        • int unused_ret;
        • unused_ret = ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return value.
          + ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return value.

        The return value is now ignored again.
        I'd suggest Holtzmann's Rule 7 in http://spinroot.com/gerard/pdf/P10.pdf
        Cast the result as void. The patches would read:

        + (void) ::lockf(f, F_ULOCK, 0);

        Both problems solved.

        Show
        Chuck Rolke added a comment - This patch appears to re-install warnings for other users. Specifically: int unused_ret; unused_ret = ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return value. + ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return value. The return value is now ignored again. I'd suggest Holtzmann's Rule 7 in http://spinroot.com/gerard/pdf/P10.pdf Cast the result as void. The patches would read: + (void) ::lockf(f, F_ULOCK, 0); Both problems solved.
        Hide
        Darryl L. Pierce added a comment -

        Thanks for the feedback. I've modified the patch and have resubmitted it.

        Show
        Darryl L. Pierce added a comment - Thanks for the feedback. I've modified the patch and have resubmitted it.
        Hide
        Darryl L. Pierce added a comment -

        Refactored patch.

        Show
        Darryl L. Pierce added a comment - Refactored patch.
        Hide
        Andrew Stitcher added a comment -

        Committed as very similar but more extensive patch I was already working on.

        Show
        Andrew Stitcher added a comment - Committed as very similar but more extensive patch I was already working on.

          People

          • Assignee:
            Andrew Stitcher
            Reporter:
            Darryl L. Pierce
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development