From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id AE4123852777; Thu, 9 Jun 2022 13:41:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE4123852777 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: use test_compiler_info in gcc_major_version X-Act-Checkin: binutils-gdb X-Git-Author: Nils-Christian Kempke X-Git-Refname: refs/heads/master X-Git-Oldrev: 8f4141b0aef3ca513969ff2605f93d07301810e3 X-Git-Newrev: 61ee7510b3fa24ca48b6c053c4fad5916a6b01ff Message-Id: <20220609134115.AE4123852777@sourceware.org> Date: Thu, 9 Jun 2022 13:41:15 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jun 2022 13:41:15 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D61ee7510b3fa= 24ca48b6c053c4fad5916a6b01ff commit 61ee7510b3fa24ca48b6c053c4fad5916a6b01ff Author: Nils-Christian Kempke Date: Tue Jun 7 12:16:36 2022 +0200 gdb/testsuite: use test_compiler_info in gcc_major_version =20 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. =20 The preferred way of getting the compiler string is via calling test_compiler_info without arguments. Gcc_major_version was changed to do that. Diff: --- gdb/testsuite/lib/gdb.exp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 6a3fed110a8..7b11dab870e 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4218,12 +4218,11 @@ proc test_compiler_info { {compiler ""} {language "= "} } { # For gcc 7.5.0, the major version 7. =20 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 !=3D 1 } { return -1