This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[OBVIOUS] gdb.threads/pthreads.c: add return statements


Here is a patch to gdb.threads/pthreads.c.  This is another patch
to work around the gcc 3.1 warning "no return statement in function
returning non-void".

This was lurking in the test results as "unsupported".  I overhauled
my tables this week and the Attention Tables now show "unresolved",
"untested", and "unsupported", so this problem became visible.

For this file, gcc is correct in all of its warnings.  The functions in
question actually do return in a finite time (about four months for the
longest function).

So I consider this an obvious fix, and I am going to go ahead and
commit it.  If it's not obvious I'll be happy to undo it and back off
my aggression level for obviousness.

Tested with:

  [target=native host=i686-pc-linux-gnu%rh-7.2 gdb=HEAD%20020223 gcc=2.95.3 glibc=vendor goption=-gdwarf-2]
  [target=native host=i686-pc-linux-gnu%rh-7.2 gdb=HEAD%20020223 gcc=2.95.3 glibc=vendor goption=-gstabs+]
  [target=native host=i686-pc-linux-gnu%rh-7.2 gdb=HEAD%20020223 gcc=3.0.4 glibc=vendor goption=-gdwarf-2]
  [target=native host=i686-pc-linux-gnu%rh-7.2 gdb=HEAD%20020223 gcc=3.0.4 glibc=vendor goption=-gstabs+]
  [target=native host=i686-pc-linux-gnu%rh-7.2 gdb=HEAD%20020223 gcc=HEAD%20020223 glibc=vendor goption=-gdwarf-2]
  [target=native host=i686-pc-linux-gnu%rh-7.2 gdb=HEAD%20020223 gcc=HEAD%20020223 glibc=vendor goption=-gstabs+]

With gcc 2.95.3 and gcc 3.0.4, there are no changes.  With gcc HEAD%20020223,
the test script runs, and all of the tests PASS.

Michael C

===

2002-02-24  Michael Chastain  <mec@shout.net>

	* gdb.threads/pthreads.c (thread1): Add a return statement.
	(thread2): Likewise.
	(foo): Likewise.

Index: gdb/testsuite/gdb.threads/pthreads.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/pthreads.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 pthreads.c
*** pthreads.c	1999/04/16 01:34:36	1.1.1.1
--- pthreads.c	2002/02/24 20:27:15
***************
*** 79,84 ****
--- 79,85 ----
        common_routine (1);
        sleep(1);
      }
+   return (void *) 0;
  }
  
  static void *
***************
*** 96,104 ****
        sleep(1);
      }
    sleep(100);
  }
  
! int
  foo (a, b, c)
       int a, b, c;
  {
--- 97,106 ----
        sleep(1);
      }
    sleep(100);
+   return (void *) 0;
  }
  
! void
  foo (a, b, c)
       int a, b, c;
  {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]