This variable/symbol/macro ought to be defined by the system includes, not us.
Alternative to #33570.
This variable/symbol/macro ought to be defined by the system includes, not us.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--006a51241073e994b41acfe9ec718e94-->
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33675.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
Concept ACK.
Concept ACK
(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.
It appears that mac OS actually requires defining it manually.