build: Re-enable -Wdeprecated-copy #22240

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:210614-revert changing 1 files +0 −1
  1. hebasto commented at 3:16 pm on June 14, 2021: member

    This PR reverts commit 0c63f808542ba02fc41aa90b1d96e9123f16d8ad (#18738), because the initial issue is no longer a thing.

    Tested on the following systems:

    • Ubuntu Focal + Qt 5.12.8:
      • ~gcc 9.3.0~ test is wrong
      • clang 10.0.0
      • clang 11.0.0
    • Fedora 34 + Qt 5.15.2
      • gcc 11.1.1
      • clang 12.0.0

    Although, did not test this configuration.

    Closes #18967.

  2. Revert "build: Suppress -Wdeprecated-copy warnings"
    This reverts commit 0c63f808542ba02fc41aa90b1d96e9123f16d8ad.
    25f19ef476
  3. MarcoFalke commented at 3:57 pm on June 14, 2021: member
    review ACK 25f19ef476eaf450ae8af4b16bc08eda93763b81
  4. DrahtBot added the label Build system on Jun 14, 2021
  5. practicalswift commented at 8:34 pm on June 14, 2021: contributor

    cr ACK 25f19ef476eaf450ae8af4b16bc08eda93763b81: patch looks correct

    Note to reviewers: -Wdeprecated-copy is enabled as part of g++ -Wextra

  6. DrahtBot commented at 8:55 pm on June 14, 2021: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #21430 (build: Add -Werror=implicit-fallthrough compile flag by hebasto)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. laanwj added this to the milestone 22.0 on Jun 15, 2021
  8. achow101 commented at 6:00 pm on June 15, 2021: member
    Code Review ACK 14cb2e0fe1384f89b4c9ca70751e6676f438b7a5
  9. fanquake commented at 6:10 am on June 16, 2021: member

    because the initial issue is no longer a thing.

    ? The issue is definitely still a thing. If you compile this PR on Ubuntu 18.04 with the system packages (Qt 5.9.5) and Clang 10, you’re still going to see 100s of warnings, because nothing has changed there since #18738. i.e:

     0/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qstyleoption.h:620:106: note: in implicit copy assignment operator for 'QStyleOptionTitleBar' first required here
     1    QStyleOptionTitleBar(const QStyleOptionTitleBar &other) : QStyleOptionComplex(Version, Type) { *this = other; }
     2                                                                                                         ^
     3/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qstyleoption.h:640:5: warning: definition of implicit copy assignment operator for 'QStyleOptionGroupBox' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
     4    QStyleOptionGroupBox(const QStyleOptionGroupBox &other) : QStyleOptionComplex(Version, Type) { *this = other; }
     5    ^
     6/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qstyleoption.h:640:106: note: in implicit copy assignment operator for 'QStyleOptionGroupBox' first required here
     7    QStyleOptionGroupBox(const QStyleOptionGroupBox &other) : QStyleOptionComplex(Version, Type) { *this = other; }
     8                                                                                                         ^
     9/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qstyleoption.h:654:5: warning: definition of implicit copy assignment operator for 'QStyleOptionSizeGrip' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
    10    QStyleOptionSizeGrip(const QStyleOptionSizeGrip &other) : QStyleOptionComplex(Version, Type) { *this = other; }
    11    ^
    12/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qstyleoption.h:654:106: note: in implicit copy assignment operator for 'QStyleOptionSizeGrip' first required here
    13    QStyleOptionSizeGrip(const QStyleOptionSizeGrip &other) : QStyleOptionComplex(Version, Type) { *this = other; }
    14                                                                                                         ^
    15/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qstyleoption.h:670:5: warning: definition of implicit copy assignment operator for 'QStyleOptionGraphicsItem' is deprecated because it has a user-declared copy constructor [-Wdeprecated-copy]
    16    QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other) : QStyleOption(Version, Type) { *this = other; }
    17    ^
    18/usr/include/x86_64-linux-gnu/qt5/QtWidgets/qstyleoption.h:670:107: note: in implicit copy assignment operator for 'QStyleOptionGraphicsItem' first required here
    19    QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other) : QStyleOption(Version, Type) { *this = other; }
    20                                                                                                          ^
    211 warning generated.
    22  CXX      qt/qt_libbitcoinqt_a-qrc_bitcoin_locale.o
    2324 warnings generated.
    24  AR       libbitcoin_server.a
    2524 warnings generated.
    

    Tested on the following systems:

    It’s not really surprising that after testing on systems that have either a very recent release, or updated LTS version of Qt, you didn’t see any warnings, as they either have the patch that fixed the warnings, or it’s been backported.

  10. MarcoFalke commented at 6:14 am on June 16, 2021: member

    If you compile this PR on Ubuntu 18.04 with the system packages (Qt 5.9.5) and Clang 10 …

    Is this even a commonly supported config? I’d presume that GUI users are faster to update to the latest release or LTS or maybe even use the snap/flatpak/static bins.

  11. fanquake commented at 6:21 am on June 16, 2021: member

    Is this even a commonly supported config?

    I wouldn’t think it’d be that common, and you should be able to assume that anyone compiling their own binaries will understand the warnings, and is capable of passing -Wno-deprecated-copy if they don’t want to see them.

    My point here is that claiming a problem is “no longer a thing”, and then only testing for it in places where it’s obviously not going to occur, doesn’t make heaps of sense.

    I’m still ok with merging this, and will do shortly. If anything, it might serve as a barometer as to whether there are a number of users using that configuration, and whether or not they’ll open issues about these kinds of warnings.

  12. MarcoFalke commented at 6:23 am on June 16, 2021: member

    only testing for it in places where it’s obviously not going to occur

    It wasn’t obvious to me, since qt itself appeared to have abandoned the backport (maybe they opened a replacement backport or Canonical did their own backporting?)

  13. fanquake commented at 6:48 am on June 16, 2021: member

    It wasn’t obvious to me, since qt itself appeared to have abandoned the backport

    Fair enough. Given it was patched in 5.13, testing Fedora 34 + Qt 5.15.2 wasn’t going to yield anything.

    As for Ubuntu Focal + Qt 5.12.8:, my assumption was the same as yours (either different backport or Ubuntu patch), but I guess I should have just tested this myself first, as this still spews warnings…?

    I guess NACK from me for now. The testing in the OP doesn’t seem to have been done correctly.

  14. hebasto commented at 10:08 am on June 16, 2021: member
    Indeed, my tests were wrong (cannot figure out the reason of that now).
  15. hebasto closed this on Jun 16, 2021

  16. fanquake referenced this in commit 65c4a36e57 on Jun 17, 2021
  17. sidhujag referenced this in commit f5c50bd5c7 on Jun 18, 2021
  18. PastaPastaPasta referenced this in commit 65d37d9565 on Jun 27, 2021
  19. PastaPastaPasta referenced this in commit 9266377560 on Jun 28, 2021
  20. PastaPastaPasta referenced this in commit f409a32467 on Jun 29, 2021
  21. PastaPastaPasta referenced this in commit 9c480d085e on Jul 1, 2021
  22. PastaPastaPasta referenced this in commit bfb552a06b on Jul 1, 2021
  23. PastaPastaPasta referenced this in commit 6b12d652bf on Sep 21, 2021
  24. DrahtBot locked this on Aug 16, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-29 04:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me