diff mbox

Note that -Wunreachable-code used to be a warning option (PR c/69900)

Message ID 20160222211825.GR3017@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Feb. 22, 2016, 9:18 p.m. UTC
Hi!

While we ignore -Wunreachable-code option now, as we require
that GCC diagnostic options are CL_WARNING only, we should remember
that this is a former Warning option (similarly for -Werror=).

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2016-02-22  Jakub Jelinek  <jakub@redhat.com>

	PR c/69900
	* common.opt (Wunreachable-code): Add Warning flag.

	* gcc.dg/pr69900.c: New test.


	Jakub

Comments

Richard Biener Feb. 23, 2016, 11:44 a.m. UTC | #1
On Mon, Feb 22, 2016 at 10:18 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> While we ignore -Wunreachable-code option now, as we require
> that GCC diagnostic options are CL_WARNING only, we should remember
> that this is a former Warning option (similarly for -Werror=).
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

Ok.

Richard.

> 2016-02-22  Jakub Jelinek  <jakub@redhat.com>
>
>         PR c/69900
>         * common.opt (Wunreachable-code): Add Warning flag.
>
>         * gcc.dg/pr69900.c: New test.
>
> --- gcc/common.opt.jj   2016-02-16 21:43:38.000000000 +0100
> +++ gcc/common.opt      2016-02-22 12:16:53.393949080 +0100
> @@ -728,7 +728,7 @@ Common Var(warn_maybe_uninitialized) War
>  Warn about maybe uninitialized automatic variables.
>
>  Wunreachable-code
> -Common Ignore
> +Common Ignore Warning
>  Does nothing. Preserved for backward compatibility.
>
>  Wunused
> --- gcc/testsuite/gcc.dg/pr69900.c.jj   2016-02-22 12:29:22.177681519 +0100
> +++ gcc/testsuite/gcc.dg/pr69900.c      2016-02-22 12:29:09.000000000 +0100
> @@ -0,0 +1,6 @@
> +/* PR c/69900 */
> +/* { dg-do compile } */
> +
> +#pragma GCC diagnostic error "-Wunreachable-code"      /* { dg-bogus "is not an option that controls warnings" } */
> +#pragma GCC diagnostic warning "-Wunreachable-code"    /* { dg-bogus "is not an option that controls warnings" } */
> +#pragma GCC diagnostic ignored "-Wunreachable-code"    /* { dg-bogus "is not an option that controls warnings" } */
>
>         Jakub
diff mbox

Patch

--- gcc/common.opt.jj	2016-02-16 21:43:38.000000000 +0100
+++ gcc/common.opt	2016-02-22 12:16:53.393949080 +0100
@@ -728,7 +728,7 @@  Common Var(warn_maybe_uninitialized) War
 Warn about maybe uninitialized automatic variables.
 
 Wunreachable-code
-Common Ignore
+Common Ignore Warning
 Does nothing. Preserved for backward compatibility.
 
 Wunused
--- gcc/testsuite/gcc.dg/pr69900.c.jj	2016-02-22 12:29:22.177681519 +0100
+++ gcc/testsuite/gcc.dg/pr69900.c	2016-02-22 12:29:09.000000000 +0100
@@ -0,0 +1,6 @@ 
+/* PR c/69900 */
+/* { dg-do compile } */
+
+#pragma GCC diagnostic error "-Wunreachable-code"	/* { dg-bogus "is not an option that controls warnings" } */
+#pragma GCC diagnostic warning "-Wunreachable-code"	/* { dg-bogus "is not an option that controls warnings" } */
+#pragma GCC diagnostic ignored "-Wunreachable-code"	/* { dg-bogus "is not an option that controls warnings" } */