This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
testsuite/1735: schedlock.c, thread-specific.c don't compile with gcc HEAD
- From: mec dot gnu at mindspring dot com
- To: gdb-gnats at sources dot redhat dot com
- Cc: msnyder at redhat dot com
- Date: 6 Aug 2004 10:31:21 -0000
- Subject: testsuite/1735: schedlock.c, thread-specific.c don't compile with gcc HEAD
- Reply-to: mec dot gnu at mindspring dot com
>Number: 1735
>Category: testsuite
>Synopsis: schedlock.c, thread-specific.c don't compile with gcc HEAD
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unasigned
>State: open
>Class: test-bug
>Submitter-Id: net
>Arrival-Date: Fri Aug 06 10:38:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: mec.gnu@mindspring.com
>Release: gdb 6.1.1
>Organization:
>Environment:
native i686-pc-linux-gnu
gdb 6.1.1
gcc HEAD 2004-07-31
binutils 2.15
dwarf-2
>Description:
gdb.threads/schedlock.c has this bit of code:
unsigned int args[NUM+1];
...
int * myp = (int *) &args[my_number];
That draws a warning from gcc HEAD:
/berman/migchain/source/gdb-6.1.1/gdb/testsuite/gdb.threads/schedlock.c: In function `thread_function':
/berman/migchain/source/gdb-6.1.1/gdb/testsuite/gdb.threads/schedlock.c:36: warning: pointer targets in initialization differ in signedness
Similarly with thread-specific.c.
The test suite can't run the test if any warnings happen during the compile.
This is a recent change in gcc HEAD, it happened between 2004-07-15 and 2004-07-31.
I'm reporting the problem against 6.1.1 because those are the log files I have handy, but the same problem happens with gdb HEAD, too.
>How-To-Repeat:
Run the test suite with gcc HEAD.
>Fix:
The cheesy fix:
int *myp = (int *) &args[my_number];
The better fix:
unsigned int *myp = &args[my_number];
while (*myp < UINT_MAX)
{
(*myp) ++;
}
I haven't tested either of these, I just made them up.
>Release-Note:
>Audit-Trail:
>Unformatted: