From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 230003858D35 for ; Tue, 14 Jul 2020 08:36:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 230003858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id ACFC0ABCF for ; Tue, 14 Jul 2020 08:36:52 +0000 (UTC) Date: Tue, 14 Jul 2020 10:36:48 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix clone-new-thread-event.c with glibc 2.30 Message-ID: <20200714083647.GA2236@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2020 08:36:52 -0000 Hi, Starting glibc 2.30, unistd.h declares gettid (for _GNU_SOURCE). This clashes with a static gettid in test source clone-new-thread-event.c: ... gdb compile failed, gdb.threads/clone-new-thread-event.c:46:1: error: \ static declaration of 'gettid' follows non-static declaration 46 | gettid (void) | ^~~~~~ In file included from /usr/include/unistd.h:1170, from gdb.threads/clone-new-thread-event.c:27: /usr/include/bits/unistd_ext.h:34:16: note: previous declaration of 'gettid' \ was here 34 | extern __pid_t gettid (void) __THROW; | ^~~~~~ ... Fix this by renaming the static gettid to local_gettid. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix clone-new-thread-event.c with glibc 2.30 gdb/testsuite/ChangeLog: 2020-07-14 Tom de Vries * gdb.threads/clone-new-thread-event.c (gettid): Rename to ... (local_gettid): ... this. (fn): Update. --- gdb/testsuite/gdb.threads/clone-new-thread-event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.threads/clone-new-thread-event.c b/gdb/testsuite/gdb.threads/clone-new-thread-event.c index 51dbb4fae6..b4a3c04347 100644 --- a/gdb/testsuite/gdb.threads/clone-new-thread-event.c +++ b/gdb/testsuite/gdb.threads/clone-new-thread-event.c @@ -43,7 +43,7 @@ tkill (int lwpid, int signo) } static pid_t -gettid (void) +local_gettid (void) { return syscall (__NR_gettid); } @@ -51,7 +51,7 @@ gettid (void) static int fn (void *unused) { - tkill (gettid (), SIGUSR1); + tkill (local_gettid (), SIGUSR1); return 0; }