[Gc] [PATCH, boehm-gc]: Fix a couple of testcases

Uros Bizjak ubizjak at gmail.com
Wed May 12 15:44:09 PDT 2010


Hello!

As shown in [1], missing return statement in main function triggers a
spurious test failure on alphaev68-pc-linux-gnu.

Attached patch adds missing declarations and return statements where
applicable.

2010-05-13  Uros Bizjak  <ubizjak at gmail.com>

	* tests/leak_test.c (main): Declare as int.  Return 0.
	* tests/thread_leak_test.c (main): Ditto.
	* tests/trace_test.c (main): Ditto.

Tested (only leak test) on alphaev68-pc-linux-gnu.

Patch was committed to SVN gcc under obvious rule.

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42811#c16

Uros.
-------------- next part --------------
Index: thread_leak_test.c
===================================================================
--- thread_leak_test.c	(revision 159243)
+++ thread_leak_test.c	(working copy)
@@ -19,7 +19,7 @@ void * test(void * arg) {
 
 #define NTHREADS 5
 
-main() {
+int main() {
     int i;
     pthread_t t[NTHREADS];
     int code;
@@ -37,4 +37,5 @@ main() {
     CHECK_LEAKS();
     CHECK_LEAKS();
     CHECK_LEAKS();
+    return 0;
 }
Index: leak_test.c
===================================================================
--- leak_test.c	(revision 159243)
+++ leak_test.c	(working copy)
@@ -1,6 +1,6 @@
 #include "leak_detector.h"
 
-main() {
+int main() {
     int *p[10];
     int i;
     GC_find_leak = 1; /* for new collect versions not compiled  */
@@ -18,4 +18,5 @@ main() {
     CHECK_LEAKS();
     CHECK_LEAKS();
     CHECK_LEAKS();
+    return 0;
 }       
Index: trace_test.c
===================================================================
--- trace_test.c	(revision 159243)
+++ trace_test.c	(working copy)
@@ -16,7 +16,7 @@ struct treenode * mktree(int i) {
   return r;
 }
 
-main()
+int main()
 {
   int i;
   for (i = 0; i < 10; ++i) {
@@ -26,4 +26,5 @@ main()
   GC_generate_random_backtrace();
   GC_generate_random_backtrace();
   GC_generate_random_backtrace();
+  return 0;
 }


More information about the Gc mailing list