Silence false positive GCC warning in wallet/rpcwallet.cpp #20386

pull kristapsk wants to merge 2 commits into bitcoin:master from kristapsk:rpcwallet-silence-warning changing 1 files +2 −1
  1. kristapsk commented at 1:21 AM on November 14, 2020: contributor

    Resolves #20381.

  2. Silence false positive GCC warning 29c66ace5c
  3. fanquake added the label Wallet on Nov 14, 2020
  4. jonatack commented at 8:10 AM on November 14, 2020: member

    While here, it looks like the "#include <optional.h>" header should be added.

  5. Add missing optional.h include 049feabf28
  6. jnewbery commented at 10:59 AM on November 14, 2020: member

    utACK 049feabf289ace817a3da62fe84942d0200b8f0b

    No harm in doing this now, although I expect we'll swap our usage of boost::optional for std::optional very soon after moving to c++17.

  7. promag commented at 11:05 AM on November 14, 2020: member

    ACK 29c66ace5c777b56cd9e19756a1ab0801d15a5ae.

    nit, could squash.

  8. kristapsk commented at 11:19 AM on November 14, 2020: contributor

    @promag , could, but, OTOH, they are two different (although related) changes.

  9. practicalswift commented at 4:49 PM on November 14, 2020: contributor

    ACK 049feabf289ace817a3da62fe84942d0200b8f0b: diagnostics signal to noise is increased by getting rid of false positives

  10. jnewbery commented at 4:52 PM on November 14, 2020: member

    @promag did you mean to ACK the head commit 049feabf289ace817a3da62fe84942d0200b8f0b?

  11. hebasto commented at 9:03 AM on November 15, 2020: member

    Similar issues have a long history in the repo:

    Particularly, this warning was discussed in #17954.

    Considering that switching to C++17 is around the corner, and std::make_optional has no known drawbacks, I'd suggest to postpone addressing compiler warnings until using std::make_optional.

  12. elichai commented at 10:42 AM on November 15, 2020: contributor

    I'm with @hebasto Concept NACK, my reasoning are: #18198 (comment) I'd prefer silencing those warnings until we can switch to std::optional

  13. MarcoFalke added this to the milestone 0.21.0 on Nov 15, 2020
  14. MarcoFalke commented at 5:31 PM on November 15, 2020: member

    Going to merge this, otherwise we'll have to close a flood of issues complaining about the warning. I'll make sure to remove the workarounds after branch-off, as neither the workarounds nor MakeOptional is needed with C++17

  15. hebasto approved
  16. hebasto commented at 5:33 PM on November 15, 2020: member

    ACK 049feabf289ace817a3da62fe84942d0200b8f0b, I have reviewed the code and it looks OK, I agree it can be merged.

  17. MarcoFalke merged this on Nov 15, 2020
  18. MarcoFalke closed this on Nov 15, 2020

  19. sidhujag referenced this in commit 1fecc4ecc9 on Nov 16, 2020
  20. DrahtBot locked this on Feb 15, 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: 2026-05-11 18:14 UTC

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