public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [www] Add note about computed gotos to changes and porting guide
@ 2021-09-29  8:15 apinski
  2021-09-29  8:50 ` Richard Biener
  2021-10-03  8:11 ` Gerald Pfeifer
  0 siblings, 2 replies; 3+ messages in thread
From: apinski @ 2021-09-29  8:15 UTC (permalink / raw)
  To: gcc-patches; +Cc: Andrew Pinski

From: Andrew Pinski <apinski@marvell.com>

Even though there is not many computed gotos in the wild and even less
that would use an integer type, it would still be a good idea to add
this new error message to both changes and the porting to guide.

OK?
---
 htdocs/gcc-12/changes.html    |  6 ++--
 htdocs/gcc-12/porting_to.html | 66 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 htdocs/gcc-12/porting_to.html

diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html
index 1f156a9..3130710 100644
--- a/htdocs/gcc-12/changes.html
+++ b/htdocs/gcc-12/changes.html
@@ -17,11 +17,9 @@
 <p>
 This page is a "brief" summary of some of the huge number of improvements
 in GCC 12.
-<!--
 You may also want to check out our
 <a href="porting_to.html">Porting to GCC 12</a> page and the
 <a href="../onlinedocs/index.html#current">full GCC documentation</a>.
--->
 </p>
 
 <p>Note: GCC 12 has not been released yet, so this document is
@@ -31,6 +29,10 @@ a work-in-progress.</p>
 <h2>Caveats</h2>
 <ul>
   <li>
+    <strong>C:</strong>
+    Computed gotos require a pointer type now.
+  </li>
+  <li>
     <strong>C++:</strong>
     Two non-standard <code>std::pair</code> constructors have been deprecated.
     These allowed the use of an rvalue and a literal <code>0</code> to
diff --git a/htdocs/gcc-12/porting_to.html b/htdocs/gcc-12/porting_to.html
new file mode 100644
index 0000000..9154d7b
--- /dev/null
+++ b/htdocs/gcc-12/porting_to.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Porting to GCC 12</title>
+<link rel="stylesheet" type="text/css" href="https://gcc.gnu.org/gcc.css" />
+</head>
+
+<body>
+<h1>Porting to GCC 12</h1>
+
+<p>
+The GCC 12 release series differs from previous GCC releases in
+<a href="changes.html">a number of ways</a>. Some of these are a result
+of bug fixing, and some old behaviors have been intentionally changed
+to support new standards, or relaxed in standards-conforming ways to
+facilitate compilation or run-time performance.
+</p>
+
+<p>
+Some of these changes are user visible and can cause grief when
+porting to GCC 12. This document is an effort to identify common issues
+and provide solutions. Let us know if you have suggestions for improvements!
+</p>
+
+
+<!--
+<h2 id="cpp">Preprocessor issues</h2>
+-->
+<h2 id="c">C language issues</h2>
+
+<h3 id="computedgotos">Computed goto now require a pointer type</h3>
+
+<p>
+In GCC 12, computed gotos require a pointer type.
+An example which was accepted before:</p>
+<pre><code>
+  void f(void)
+  {
+    goto *10;
+  }
+</code></pre>
+is no longer accepted and you need to add a cast to it like:
+
+<pre><code>
+  void f(void)
+  {
+    goto *(void*)10;
+  }
+</code></pre>
+
+<!--
+<h2 id="cxx">C++ language issues</h2>
+-->
+
+<!--
+<h2 id="fortran">Fortran language issues</h2>
+-->
+
+<!--
+<h2 id="links">Links</h2>
+-->
+
+</body>
+</html>
-- 
1.8.3.1


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

* Re: [PATCH] [www] Add note about computed gotos to changes and porting guide
  2021-09-29  8:15 [PATCH] [www] Add note about computed gotos to changes and porting guide apinski
@ 2021-09-29  8:50 ` Richard Biener
  2021-10-03  8:11 ` Gerald Pfeifer
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Biener @ 2021-09-29  8:50 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: GCC Patches

On Wed, Sep 29, 2021 at 10:16 AM apinski--- via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> From: Andrew Pinski <apinski@marvell.com>
>
> Even though there is not many computed gotos in the wild and even less
> that would use an integer type, it would still be a good idea to add
> this new error message to both changes and the porting to guide.
>
> OK?

OK.

Richard.

> ---
>  htdocs/gcc-12/changes.html    |  6 ++--
>  htdocs/gcc-12/porting_to.html | 66 +++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 70 insertions(+), 2 deletions(-)
>  create mode 100644 htdocs/gcc-12/porting_to.html
>
> diff --git a/htdocs/gcc-12/changes.html b/htdocs/gcc-12/changes.html
> index 1f156a9..3130710 100644
> --- a/htdocs/gcc-12/changes.html
> +++ b/htdocs/gcc-12/changes.html
> @@ -17,11 +17,9 @@
>  <p>
>  This page is a "brief" summary of some of the huge number of improvements
>  in GCC 12.
> -<!--
>  You may also want to check out our
>  <a href="porting_to.html">Porting to GCC 12</a> page and the
>  <a href="../onlinedocs/index.html#current">full GCC documentation</a>.
> --->
>  </p>
>
>  <p>Note: GCC 12 has not been released yet, so this document is
> @@ -31,6 +29,10 @@ a work-in-progress.</p>
>  <h2>Caveats</h2>
>  <ul>
>    <li>
> +    <strong>C:</strong>
> +    Computed gotos require a pointer type now.
> +  </li>
> +  <li>
>      <strong>C++:</strong>
>      Two non-standard <code>std::pair</code> constructors have been deprecated.
>      These allowed the use of an rvalue and a literal <code>0</code> to
> diff --git a/htdocs/gcc-12/porting_to.html b/htdocs/gcc-12/porting_to.html
> new file mode 100644
> index 0000000..9154d7b
> --- /dev/null
> +++ b/htdocs/gcc-12/porting_to.html
> @@ -0,0 +1,66 @@
> +<!DOCTYPE html>
> +<html lang="en">
> +
> +<head>
> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
> +<title>Porting to GCC 12</title>
> +<link rel="stylesheet" type="text/css" href="https://gcc.gnu.org/gcc.css" />
> +</head>
> +
> +<body>
> +<h1>Porting to GCC 12</h1>
> +
> +<p>
> +The GCC 12 release series differs from previous GCC releases in
> +<a href="changes.html">a number of ways</a>. Some of these are a result
> +of bug fixing, and some old behaviors have been intentionally changed
> +to support new standards, or relaxed in standards-conforming ways to
> +facilitate compilation or run-time performance.
> +</p>
> +
> +<p>
> +Some of these changes are user visible and can cause grief when
> +porting to GCC 12. This document is an effort to identify common issues
> +and provide solutions. Let us know if you have suggestions for improvements!
> +</p>
> +
> +
> +<!--
> +<h2 id="cpp">Preprocessor issues</h2>
> +-->
> +<h2 id="c">C language issues</h2>
> +
> +<h3 id="computedgotos">Computed goto now require a pointer type</h3>
> +
> +<p>
> +In GCC 12, computed gotos require a pointer type.
> +An example which was accepted before:</p>
> +<pre><code>
> +  void f(void)
> +  {
> +    goto *10;
> +  }
> +</code></pre>
> +is no longer accepted and you need to add a cast to it like:
> +
> +<pre><code>
> +  void f(void)
> +  {
> +    goto *(void*)10;
> +  }
> +</code></pre>
> +
> +<!--
> +<h2 id="cxx">C++ language issues</h2>
> +-->
> +
> +<!--
> +<h2 id="fortran">Fortran language issues</h2>
> +-->
> +
> +<!--
> +<h2 id="links">Links</h2>
> +-->
> +
> +</body>
> +</html>
> --
> 1.8.3.1
>

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

* Re: [PATCH] [www] Add note about computed gotos to changes and porting guide
  2021-09-29  8:15 [PATCH] [www] Add note about computed gotos to changes and porting guide apinski
  2021-09-29  8:50 ` Richard Biener
@ 2021-10-03  8:11 ` Gerald Pfeifer
  1 sibling, 0 replies; 3+ messages in thread
From: Gerald Pfeifer @ 2021-10-03  8:11 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc-patches

On Wed, 29 Sep 2021, apinski--- via Gcc-patches wrote:
> Even though there is not many computed gotos in the wild and even less
> that would use an integer type, it would still be a good idea to add
> this new error message to both changes and the porting to guide.

Lovely, thank you!

> +<h3 id="computedgotos">Computed goto now require a pointer type</h3>

Is there an "s" missing somewhere here, e.g. "require*s" or "goto*s*"?

Gerald

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

end of thread, other threads:[~2021-10-03  8:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29  8:15 [PATCH] [www] Add note about computed gotos to changes and porting guide apinski
2021-09-29  8:50 ` Richard Biener
2021-10-03  8:11 ` Gerald Pfeifer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).