refactor: Remove useless extern keyword #21902

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2105-cppExtern changing 6 files +14 −15
  1. MarcoFalke commented at 7:12 am on May 10, 2021: member
  2. refactor: Remove useless extern keyword fa4bbd306e
  3. fanquake added the label Refactoring on May 10, 2021
  4. jonatack commented at 9:36 am on May 10, 2021: member

    Concept ACK, it’s confusing for me at least. There are more of these, but when they are before constants, mutexes, and functions (e.g. not for language linking) it’s not clear to me when they are needed.

    Light code review ACK fa4bbd306e1ca369d02eb864983fbb4d64b50ca9

  5. laanwj commented at 12:00 pm on May 10, 2021: member

    https://en.cppreference.com/w/cpp/language/storage_duration#external_linkage

    So basically: never use extern for functions, as they have external linkage by default, only for variables? This keeps coming back so it would be good to write it down in the developer notes.

  6. MarcoFalke commented at 12:08 pm on May 10, 2021: member

    This keeps coming back so it would be good to write it down in the developer notes.

    It seems all additions date back at least 5 years, so we didn’t have any issues with this recently. And it shouldn’t cause any harm. It is simply redundant. I’ll leave this as if for now, but I am happy to review a pull that adds this to the dev notes.

  7. hebasto approved
  8. hebasto commented at 4:06 pm on May 10, 2021: member
    ACK fa4bbd306e1ca369d02eb864983fbb4d64b50ca9, I’ve verified that all of the remained extern keywords specify either (a) a variable with external linkage, or (b) a symbol with “C” language linkage.
  9. practicalswift commented at 6:05 pm on May 10, 2021: contributor
    cr ACK fa4bbd306e1ca369d02eb864983fbb4d64b50ca9: patch looks correct
  10. Talkless commented at 6:35 pm on May 10, 2021: none
    utACK fa4bbd306e1ca369d02eb864983fbb4d64b50ca9, built successfully on Debian Sid, looks OK.
  11. promag commented at 9:28 pm on May 10, 2021: member
    Code review ACK fa4bbd306e1ca369d02eb864983fbb4d64b50ca9.
  12. fanquake merged this on May 10, 2021
  13. fanquake closed this on May 10, 2021

  14. sidhujag referenced this in commit 071c0c6edb on May 11, 2021
  15. MarcoFalke deleted the branch on May 11, 2021
  16. gwillen referenced this in commit 9ea813efb8 on Jun 1, 2022
  17. DrahtBot locked this on Aug 18, 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-07-03 10:13 UTC

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