The procedure gcc_major_version was earlier using the global variable
compiler_info to retrieve gcc's major version. This is discouraged and
(as can be read in a comment in compiler.c) compiler_info should be
local to get_compiler_info and test_compiler_info.
The preferred way of getting the compiler string is via calling
test_compiler_info without arguments. Gcc_major_version was changed to
do that.
# For gcc 7.5.0, the major version 7.
proc gcc_major_version { } {
- global compiler_info
global decimal
if { ![test_compiler_info "gcc-*"] } {
return -1
}
- set res [regexp gcc-($decimal)-($decimal)- $compiler_info \
+ set res [regexp gcc-($decimal)-($decimal)- [test_compiler_info] \
dummy_var major minor]
if { $res != 1 } {
return -1