Copilot commented on code in PR #3419:
URL: https://github.com/apache/brpc/pull/3419#discussion_r3681565484
##########
tools/print_gcc_version.sh:
##########
@@ -19,22 +19,30 @@ while read -r line; do
val=$(echo "$line" | awk '{print $3}')
if [[ $line =~ __clang__ ]]; then
CLANG=${val}
+ elif [[ $line =~ __clang_major__ ]]; then
+ CLANG_MAJOR=${val}
+ elif [[ $line =~ __clang_minor__ ]]; then
+ CLANG_MINOR=${val}
Review Comment:
The `__clang__` pattern is too broad here: `__clang_major__` /
`__clang_minor__` lines also match `__clang__`, so `CLANG_MAJOR`/`CLANG_MINOR`
never get set. This makes Clang fall through to the GCC-macro path (Clang
defines `__GNUC__`), which can incorrectly reject modern Clang/AppleClang in
`config_brpc.sh` (e.g., reporting 4.x and failing the 5.0+ threshold).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]