random: scope environ extern to macOS, BSDs and Illumos #33714

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:drop_some_platforms changing 1 files +6 −2
  1. fanquake commented at 4:38 pm on October 27, 2025: member
    These platforms fail to compile with it removed. macOS: #33675 BSDs / Illumos: https://github.com/hebasto/bitcoin-core-nightly/pull/79.
  2. DrahtBot added the label Utils/log/libs on Oct 27, 2025
  3. DrahtBot commented at 4:38 pm on October 27, 2025: contributor

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

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33714.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Stale ACK hebasto

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. hebasto approved
  5. hebasto commented at 4:44 pm on October 27, 2025: member
    ACK f24ef2b4e01884ac1dea07ebbc7e7d0aa2c09541.
  6. in src/randomenv.cpp:60 in f24ef2b4e0
    57@@ -58,7 +58,7 @@
    58 #endif
    59 
    60 #ifndef WIN32
    


    l0rinc commented at 7:47 pm on October 27, 2025:

    If it’s only needed on Mac, wouldn’t:

    0#ifdef __APPLE__
    

    be better here?


    fanquake commented at 5:47 pm on October 28, 2025:
    I’m not 100% sure that is the only place it’s needed, however this has historically been unclear, and the only platform I’m aware of that definitely needs it, is macOS.
  7. fanquake force-pushed on Oct 28, 2025
  8. fanquake renamed this:
    random: clarify where the environ extern is needed
    random: scope the environ extern to macOS
    on Oct 28, 2025
  9. DrahtBot renamed this:
    random: scope the environ extern to macOS
    random: scope the environ extern to macOS
    on Oct 28, 2025
  10. hebasto commented at 7:58 pm on October 28, 2025: member
  11. hebasto commented at 0:52 am on October 29, 2025: member

    Testing on some other platforms: hebasto/bitcoin-core-nightly#79.

    Builds on the *BSD and illumos systems failed.

  12. fanquake force-pushed on Oct 29, 2025
  13. fanquake renamed this:
    random: scope the environ extern to macOS
    random: scope environ extern to macOS, BSDs and Illumos
    on Oct 29, 2025
  14. in src/randomenv.cpp:61 in fcdbce4a04 outdated
    56@@ -57,8 +57,12 @@
    57 #include <sys/auxv.h>
    58 #endif
    59 
    60-#ifndef WIN32
    61-extern char** environ; // NOLINT(readability-redundant-declaration): Necessary on some platforms
    


    maflcko commented at 12:52 pm on October 29, 2025:

    nit: I think the comment can be kept as-is, or just refer to “Necessary on the above platforms”. Otherwise, it is just one more line to maintain.

    Also, I wonder if this can just be checked at configure-time, but no strong opinion.


    fanquake commented at 3:14 pm on October 29, 2025:
    Re-modified the comment. Not sure there is too much value in moving this to configure.
  15. hebasto approved
  16. hebasto commented at 1:41 pm on October 29, 2025: member
    ACK fcdbce4a040e4a40aac9ed5ef8634b09d092063e.
  17. random: scope environ extern to macOS, BSDs and Illumos
    These platforms fail to compile with it removed.
    79d6f458e2
  18. fanquake force-pushed on Oct 29, 2025

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: 2025-10-31 06:13 UTC

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