Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: Michael Chastain <mec.gnu@mindspring.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [rfa/testsuite/threads] fix gcc signed/unsigned warning
Date: Fri, 27 Aug 2004 02:41:00 -0000	[thread overview]
Message-ID: <412E9F3A.4010200@redhat.com> (raw)
In-Reply-To: <412E17EE.nail6CX1NP8LE@mindspring.com>

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  <mec.gnu@mindspring.com>
> 
> 	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)
> 



  reply	other threads:[~2004-08-27  2:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-26 17:03 Michael Chastain
2004-08-27  2:41 ` Michael Snyder [this message]
2004-08-27 11:23   ` Michael Chastain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=412E9F3A.4010200@redhat.com \
    --to=msnyder@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec.gnu@mindspring.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox