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

    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/33675.

    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.

  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:

     0[ 13%] Building CXX object src/util/CMakeFiles/bitcoin_util.dir/__/randomenv.cpp.o
     1cd /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  
     2/home/admin/actions-runner/_work/_temp/src/randomenv.cpp:312:69: error: use of undeclared identifier 'environ'
     3  312 |     hasher << &hasher << &RandAddStaticEnv << &malloc << &errno << &environ;
     4      |                                                                     ^
     5/home/admin/actions-runner/_work/_temp/src/randomenv.cpp:452:9: error: use of undeclared identifier 'environ'
     6  452 |     if (environ) {
     7      |         ^
     8/home/admin/actions-runner/_work/_temp/src/randomenv.cpp:453:28: error: use of undeclared identifier 'environ'
     9  453 |         for (size_t i = 0; environ[i]; ++i) {
    10      |                            ^
    11/home/admin/actions-runner/_work/_temp/src/randomenv.cpp:454:48: error: use of undeclared identifier 'environ'; did you mean 'union'?
    12  454 |             hasher.Write((const unsigned char*)environ[i], strlen(environ[i]));
    13      |                                                ^~~~~~~
    14      |                                                union
    15/home/admin/actions-runner/_work/_temp/src/randomenv.cpp:454:48: error: expected expression
    16/home/admin/actions-runner/_work/_temp/src/randomenv.cpp:454:67: error: use of undeclared identifier 'environ'
    17  454 |             hasher.Write((const unsigned char*)environ[i], strlen(environ[i]));
    18      |                                                                   ^
    196 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: 2025-10-31 06:13 UTC

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