From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19006 invoked by alias); 8 Apr 2003 21:16:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18995 invoked from network); 8 Apr 2003 21:16:07 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 8 Apr 2003 21:16:07 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h38LG7e30711 for ; Tue, 8 Apr 2003 17:16:07 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h38LG7J19394 for ; Tue, 8 Apr 2003 17:16:07 -0400 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h38LG5m07715 for ; Tue, 8 Apr 2003 17:16:06 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 971682C43E; Tue, 8 Apr 2003 17:20:20 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16019.15635.929065.664152@localhost.redhat.com> Date: Tue, 08 Apr 2003 21:16:00 -0000 To: gdb-patches@sources.redhat.com Subject: [RFA/TESTSUITE] build schedlock.c on 64-bit platforms X-SW-Source: 2003-04/txt/msg00137.txt.bz2 I was getting warnings when compiling the test on 64-bit because of the casts. /home/ezannoni/gdb-sources/src/gdb/testsuite/gdb.threads/schedlock.c: In function `main': /home/ezannoni/gdb-sources/src/gdb/testsuite/gdb.threads/schedlock.c:21: warning: cast to pointer from integer of different size /home/ezannoni/gdb-sources/src/gdb/testsuite/gdb.threads/schedlock.c:26: warning: cast to pointer from integer of different size /home/ezannoni/gdb-sources/src/gdb/testsuite/gdb.threads/schedlock.c: In function `thread_function': /home/ezannoni/gdb-sources/src/gdb/testsuite/gdb.threads/schedlock.c:32: warning: cast from pointer to integer of different size Michael, Daniel? elena 2003-04-08 Elena Zannoni * gdb.threads/schedlock.c: Cast to thread function argument to long, for 64-bit platforms. Index: schedlock.c =================================================================== RCS file: /cvs/uberbaum/gdb/testsuite/gdb.threads/schedlock.c,v retrieving revision 1.2 diff -u -p -r1.2 schedlock.c --- schedlock.c 23 Oct 2002 03:22:56 -0000 1.2 +++ schedlock.c 8 Apr 2003 20:56:31 -0000 @@ -18,18 +18,21 @@ int main() { for (i = 0; i < NUM; i++) { args[i] = 1; - res = pthread_create(&threads[i], NULL, thread_function, (void *)i); + res = pthread_create(&threads[i], + NULL, + thread_function, + (void *) (long) i); } /* schedlock.exp: last thread start. */ args[i] = 1; - thread_function ((void *) i); + thread_function ((void *) (long) i); exit(EXIT_SUCCESS); } void *thread_function(void *arg) { - int my_number = (int) arg; + int my_number = (long) arg; int *myp = &args[my_number]; /* Don't run forever. Run just short of it :) */