From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14528 invoked by alias); 26 Aug 2004 17:03:48 -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 14507 invoked from network); 26 Aug 2004 17:03:45 -0000 Received: from unknown (HELO smtp10.atl.mindspring.net) (207.69.200.246) by sourceware.org with SMTP; 26 Aug 2004 17:03:45 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by smtp10.atl.mindspring.net with esmtp (Exim 3.33 #1) id 1C0Nf5-0000KE-00; Thu, 26 Aug 2004 13:03:43 -0400 Received: from mindspring.com (localhost [127.0.0.1]) by berman.michael-chastain.com (Postfix) with SMTP id F1E7D4B102; Thu, 26 Aug 2004 13:03:42 -0400 (EDT) Date: Thu, 26 Aug 2004 17:03:00 -0000 From: Michael Chastain To: msnyder@redhat.com Subject: [rfa/testsuite/threads] fix gcc signed/unsigned warning Cc: gdb-patches@sources.redhat.com Message-ID: <412E17EE.nail6CX1NP8LE@mindspring.com> User-Agent: nail 10.8 6/28/04 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00712.txt.bz2 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? 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)