randomenv: drop self define of 'environ' #33675

pull sipa wants to merge 1 commits into bitcoin:master from sipa:202510_no_environ_override changing 1 files +0 −4
  1. sipa commented at 8:59 AM on October 22, 2025: member

    This variable/symbol/macro ought to be defined by the system includes, not us.

    Alternative to #33570.

  2. randomenv: drop self define of 'environ'
    This variable/symbol/macro ought to be defined by the system includes, not us.
    d9283f418c
  3. DrahtBot commented at 9:00 AM on October 22, 2025: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept ACK hebasto, laanwj

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

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. laanwj added the label Windows on Oct 22, 2025
  5. laanwj added the label Utils/log/libs on Oct 22, 2025
  6. hebasto commented at 9:01 AM on October 22, 2025: member

    Concept ACK.

  7. laanwj removed the label Windows on Oct 22, 2025
  8. laanwj commented at 9:01 AM on October 22, 2025: member

    Concept ACK

  9. maflcko commented at 9:06 AM on October 22, 2025: member

    (mimicking drahtbot, bleeb blop)

    https://github.com/bitcoin/bitcoin/actions/runs/18710961104/job/53359113198?pr=33675#step:9:1582:

    [ 13%] Building CXX object src/util/CMakeFiles/bitcoin_util.dir/__/randomenv.cpp.o
    cd /home/admin/actions-runner/_work/_temp/build/src/util && /bin/ccache /usr/bin/clang++ --target=arm64-apple-darwin -isysroot/home/admin/actions-runner/_work/_temp/depends/SDKs/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers -nostdlibinc -iwithsysroot/usr/include/c++/v1 -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks --target=arm64-apple-darwin -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -I/home/admin/actions-runner/_work/_temp/build/src -I/home/admin/actions-runner/_work/_temp/src -mmacos-version-min=14.0 -mlinker-version=711 -O2 -O2 -g -std=c++20 -fPIC -fvisibility=hidden -fdebug-prefix-map=/home/admin/actions-runner/_work/_temp/src=. -fmacro-prefix-map=/home/admin/actions-runner/_work/_temp/src=. -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -mbranch-protection=bti -Werror -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -MD -MT src/util/CMakeFiles/bitcoin_util.dir/__/randomenv.cpp.o -MF CMakeFiles/bitcoin_util.dir/__/randomenv.cpp.o.d -o CMakeFiles/bitcoin_util.dir/__/randomenv.cpp.o -c /home/admin/actions-runner/_work/_temp/src/randomenv.cpp  
    /home/admin/actions-runner/_work/_temp/src/randomenv.cpp:312:69: error: use of undeclared identifier 'environ'
      312 |     hasher << &hasher << &RandAddStaticEnv << &malloc << &errno << &environ;
          |                                                                     ^
    /home/admin/actions-runner/_work/_temp/src/randomenv.cpp:452:9: error: use of undeclared identifier 'environ'
      452 |     if (environ) {
          |         ^
    /home/admin/actions-runner/_work/_temp/src/randomenv.cpp:453:28: error: use of undeclared identifier 'environ'
      453 |         for (size_t i = 0; environ[i]; ++i) {
          |                            ^
    /home/admin/actions-runner/_work/_temp/src/randomenv.cpp:454:48: error: use of undeclared identifier 'environ'; did you mean 'union'?
      454 |             hasher.Write((const unsigned char*)environ[i], strlen(environ[i]));
          |                                                ^~~~~~~
          |                                                union
    /home/admin/actions-runner/_work/_temp/src/randomenv.cpp:454:48: error: expected expression
    /home/admin/actions-runner/_work/_temp/src/randomenv.cpp:454:67: error: use of undeclared identifier 'environ'
      454 |             hasher.Write((const unsigned char*)environ[i], strlen(environ[i]));
          |                                                                   ^
    6 errors generated.
    
  10. sipa closed this on Oct 22, 2025

  11. sipa commented at 9:12 AM on October 22, 2025: member

    It appears that mac OS actually requires defining it manually.

  12. fanquake commented at 4:38 PM on October 27, 2025: member

    Documented this in #33714.


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-04-13 15:12 UTC

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