Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA #2] gdb.threads/linux-dp.c: accommodate gcc 3.1
@ 2002-02-23 14:46 Michael Elizabeth Chastain
  2002-02-23 15:28 ` Michael Snyder
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Elizabeth Chastain @ 2002-02-23 14:46 UTC (permalink / raw)
  To: gdb-patches

This is RFA #2 for this patch.

gcc HEAD has a new warning:

  warning: no return statement in function returning non-void

Unfortunately this breaks code in gdb.threads/linux-dp.c:

  void *
  philosopher (void *data)
  {
    ...
    for (;;)
      {
	...
      }
  }

I consider this to be a bug in gcc HEAD, and I've filed PR gcc/5725.

Meanwhile, I would like to change linux-dp.c so that it compiles.
This way we are testing linux thread support, which is more useful
than functioning as a test case for PR gcc/5725.

I tested this patch on:

  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=2.95.3 glibc=vendor goption=-gdwarf-2]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=2.95.3 glibc=vendor goption=-gstabs+]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.3 glibc=vendor goption=-gdwarf-2]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.3 glibc=vendor goption=-gstabs+]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.4-20020215 glibc=vendor goption=-gdwarf-2]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.4-20020215 glibc=vendor goption=-gstabs+]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.4 glibc=vendor goption=-gdwarf-2]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.4 glibc=vendor goption=-gstabs+]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=gcc-3_0-branch%20020222 glibc=vendor goption=-gdwarf-2]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=gcc-3_0-branch%20020222 glibc=vendor goption=-gstabs+]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=HEAD%20020222 glibc=vendor goption=-gdwarf-2]
  [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=HEAD%20020222 glibc=vendor goption=-gstabs+]

References:

  Jason's message about the new warning:
  http://gcc.gnu.org/ml/gcc-patches/2002-02/msg00034.html

  My reply in the thread:
  http://gcc.gnu.org/ml/gcc-patches/2002-02/msg00704.html

  My gcc PR:
  http://gcc.gnu.org/cgi-bin/gnatsweb.pl?database=gcc&cmd=view&pr=5725

Okay to apply?

Michael C

===

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

	* gdb.threads/linux-dp.c (philosopher): Add a return statement
	to placate gcc.

Index: gdb/testsuite/gdb.threads/linux-dp.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/linux-dp.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 linux-dp.c
*** linux-dp.c	1999/10/19 02:46:48	1.1.1.1
--- linux-dp.c	2002/02/18 21:37:54
*************** philosopher (void *data)
*** 153,158 ****
--- 153,160 ----
  	pthread_mutex_unlock (&fork_mutex[(n + 1) % num_philosophers]);
  	random_delay ();
        }
+ 
+   return (void *) 0;
  }
  
  int


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA #2] gdb.threads/linux-dp.c: accommodate gcc 3.1
  2002-02-23 14:46 [RFA #2] gdb.threads/linux-dp.c: accommodate gcc 3.1 Michael Elizabeth Chastain
@ 2002-02-23 15:28 ` Michael Snyder
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Snyder @ 2002-02-23 15:28 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: gdb-patches

Michael Elizabeth Chastain wrote:
> 
> This is RFA #2 for this patch.
> 
> gcc HEAD has a new warning:
> 
>   warning: no return statement in function returning non-void
> 
> Unfortunately this breaks code in gdb.threads/linux-dp.c:
> 
>   void *
>   philosopher (void *data)
>   {
>     ...
>     for (;;)
>       {
>         ...
>       }
>   }
> 
> I consider this to be a bug in gcc HEAD, and I've filed PR gcc/5725.
> 
> Meanwhile, I would like to change linux-dp.c so that it compiles.
> This way we are testing linux thread support, which is more useful
> than functioning as a test case for PR gcc/5725.
> 
> I tested this patch on:
> 
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=2.95.3 glibc=vendor goption=-gdwarf-2]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=2.95.3 glibc=vendor goption=-gstabs+]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.3 glibc=vendor goption=-gdwarf-2]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.3 glibc=vendor goption=-gstabs+]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.4-20020215 glibc=vendor goption=-gdwarf-2]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.4-20020215 glibc=vendor goption=-gstabs+]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.4 glibc=vendor goption=-gdwarf-2]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=3.0.4 glibc=vendor goption=-gstabs+]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=gcc-3_0-branch%20020222 glibc=vendor goption=-gdwarf-2]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=gcc-3_0-branch%20020222 glibc=vendor goption=-gstabs+]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=HEAD%20020222 glibc=vendor goption=-gdwarf-2]
>   [target=native host=i686-pc-linux%rh-7.2 gdb=HEAD gcc=HEAD%20020222 glibc=vendor goption=-gstabs+]
> 
> References:
> 
>   Jason's message about the new warning:
>   http://gcc.gnu.org/ml/gcc-patches/2002-02/msg00034.html
> 
>   My reply in the thread:
>   http://gcc.gnu.org/ml/gcc-patches/2002-02/msg00704.html
> 
>   My gcc PR:
>   http://gcc.gnu.org/cgi-bin/gnatsweb.pl?database=gcc&cmd=view&pr=5725
> 
> Okay to apply?
> 
> Michael C

Looks good to me...

> 
> ===
> 
> 2002-02-18  Michael Chastain  <mec@shout.net>
> 
>         * gdb.threads/linux-dp.c (philosopher): Add a return statement
>         to placate gcc.
> 
> Index: gdb/testsuite/gdb.threads/linux-dp.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/linux-dp.c,v
> retrieving revision 1.1.1.1
> diff -c -3 -p -r1.1.1.1 linux-dp.c
> *** linux-dp.c  1999/10/19 02:46:48     1.1.1.1
> --- linux-dp.c  2002/02/18 21:37:54
> *************** philosopher (void *data)
> *** 153,158 ****
> --- 153,160 ----
>         pthread_mutex_unlock (&fork_mutex[(n + 1) % num_philosophers]);
>         random_delay ();
>         }
> +
> +   return (void *) 0;
>   }
> 
>   int


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFA #2] gdb.threads/linux-dp.c: accommodate gcc 3.1
@ 2002-02-23 16:45 Michael Elizabeth Chastain
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Elizabeth Chastain @ 2002-02-23 16:45 UTC (permalink / raw)
  To: msnyder; +Cc: gdb-patches

Committed.  Thanks Michael S.

Michael C

===

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

        * gdb.threads/linux-dp.c (philosopher): Add a return statement
          to placate gcc.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-02-24  0:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-23 14:46 [RFA #2] gdb.threads/linux-dp.c: accommodate gcc 3.1 Michael Elizabeth Chastain
2002-02-23 15:28 ` Michael Snyder
2002-02-23 16:45 Michael Elizabeth Chastain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox