From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4670 invoked by alias); 27 Aug 2004 02:41:02 -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 4654 invoked from network); 27 Aug 2004 02:41:01 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 27 Aug 2004 02:41:01 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i7R2f0S0026999 for ; Thu, 26 Aug 2004 22:41:00 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i7R2ex725263; Thu, 26 Aug 2004 22:40:59 -0400 Received: from redhat.com (dhcp-172-16-25-160.sfbay.redhat.com [172.16.25.160]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id i7R2ewV04315; Thu, 26 Aug 2004 19:40:58 -0700 Message-ID: <412E9F3A.4010200@redhat.com> Date: Fri, 27 Aug 2004 02:41:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.4.2) Gecko/20040301 MIME-Version: 1.0 To: Michael Chastain CC: gdb-patches@sources.redhat.com Subject: Re: [rfa/testsuite/threads] fix gcc signed/unsigned warning References: <412E17EE.nail6CX1NP8LE@mindspring.com> In-Reply-To: <412E17EE.nail6CX1NP8LE@mindspring.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00720.txt.bz2 Michael Chastain wrote: > This patch takes care of one set of gcc HEAD warnings in > schedlock.c and thread-specific.c. > > The code uses "unsigned int" and "signed int" for the same data, but I'm > not into changing that right now. I'm just killing the compiler warning > so the code can keep doing what it's doing. > > Tested on native i686-pc-linux-gnu with gcc 2.95.3, gcc 3.3.4, > gcc 3.4.1, and gcc HEAD 20040824, dwarf-2 and stabs+. > > Okay to commit? Well, it really looks to me as if either args should be signed, or myp should be unsigned. The test will work either way, although signed would "feel" safer. But if you want to just do this, it's OK with me. > > 2004-08-26 Michael Chastain > > Fix PR testsuite/1735. > * gdb.threads/schedlock.c (thread_function): Add a cast > to suppress a gcc warning. > * gdb.threads/thread-specific.c (thread_function): Likewise. > > Index: gdb.threads/schedlock.c > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/schedlock.c,v > retrieving revision 1.4 > diff -c -3 -p -r1.4 schedlock.c > *** gdb.threads/schedlock.c 26 Aug 2004 13:10:19 -0000 1.4 > --- gdb.threads/schedlock.c 26 Aug 2004 16:40:48 -0000 > *************** > *** 1,6 **** > /* This testcase is part of GDB, the GNU debugger. > > ! Copyright 2002, 2003 Free Software Foundation, Inc. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > --- 1,6 ---- > /* This testcase is part of GDB, the GNU debugger. > > ! Copyright 2002, 2003, 2004 Free Software Foundation, Inc. > > This program is free software; you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > *************** int main() { > *** 52,58 **** > > void *thread_function(void *arg) { > int my_number = (long) arg; > ! int *myp = &args[my_number]; > > /* Don't run forever. Run just short of it :) */ > while (*myp > 0) > --- 52,58 ---- > > void *thread_function(void *arg) { > int my_number = (long) arg; > ! int *myp = (int *) &args[my_number]; > > /* Don't run forever. Run just short of it :) */ > while (*myp > 0) > Index: gdb.threads/thread-specific.c > =================================================================== > RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/thread-specific.c,v > retrieving revision 1.1 > diff -c -3 -p -r1.1 thread-specific.c > *** gdb.threads/thread-specific.c 1 Feb 2004 18:04:37 -0000 1.1 > --- gdb.threads/thread-specific.c 26 Aug 2004 16:40:48 -0000 > *************** int main() { > *** 53,59 **** > > void *thread_function(void *arg) { > int my_number = (long) arg; > ! int *myp = &args[my_number]; > > /* Don't run forever. Run just short of it :) */ > while (*myp > 0) > --- 53,59 ---- > > void *thread_function(void *arg) { > int my_number = (long) arg; > ! int *myp = (int *) &args[my_number]; > > /* Don't run forever. Run just short of it :) */ > while (*myp > 0) >