diff mbox series

[wwwdocs] gcc-15: Mention c++ header dependency changes (<cstdint>) in porting_to.html

Message ID ZrI1caSyJQCwb7S8@fkdesktop.suse.cz
State New
Headers show
Series [wwwdocs] gcc-15: Mention c++ header dependency changes (<cstdint>) in porting_to.html | expand

Commit Message

Filip Kastl Aug. 6, 2024, 2:38 p.m. UTC
Hi,

I recently had to add '#include <cstdint>' to a program to compile it with the
latest trunk GCC due to

https://gcc.gnu.org/pipermail/gcc-patches/2024-August/659176.html

So I thought I might create the GCC 15 porting_to.html page and add an entry
about this (I just copied the entry from GCC 14 porting_to.html).

Ha!  As I'm writing this I noticed that actually Jonathan predicted this and
suggested a corresponding porting_to.html entry.  Well, here it is :).

Validated with the W3 Validator.  Is this ok to be pushed?

Cheers,
Filip Kastl


-- 8< --


---
 htdocs/gcc-15/changes.html    |  3 +-
 htdocs/gcc-15/porting_to.html | 53 +++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 2 deletions(-)
 create mode 100644 htdocs/gcc-15/porting_to.html

Comments

Gerald Pfeifer Aug. 6, 2024, 3 p.m. UTC | #1
On Tue, 6 Aug 2024, Filip Kastl wrote:
> So I thought I might create the GCC 15 porting_to.html page and add an 
> entry about this (I just copied the entry from GCC 14 porting_to.html).

Nice.

> Ha!  As I'm writing this I noticed that actually Jonathan predicted this 
> and suggested a corresponding porting_to.html entry.  Well, here it is :).

Great minds think alike, they say. :-)

> Validated with the W3 Validator.  Is this ok to be pushed?

Looks good to me, just one question to Jonathan as native speaker and one 
observation:

> +<p>
> +The following headers are used less widely in libstdc++ and may need to
> +be included explicitly when compiling with GCC 15:

Is "in libstdc++" the best option, or maybe "by ..." or "within ..."?

> +<ul>
> +<li> <code>&lt;cstdint&gt;</code>
> +  (for <code>std::int8_t</code>, <code>std::int32_t</code> etc.)
> +</li>

The text reads "headers", alas there only appears to be one right now?
So "header is" (singular)?

Gerald
Filip Kastl Aug. 7, 2024, 7:09 a.m. UTC | #2
On Tue 2024-08-06 17:00:24, Gerald Pfeifer wrote:
> > +<p>
> > +The following headers are used less widely in libstdc++ and may need to
> > +be included explicitly when compiling with GCC 15:
> > +<ul>
> > +<li> <code>&lt;cstdint&gt;</code>
> > +  (for <code>std::int8_t</code>, <code>std::int32_t</code> etc.)
> > +</li>
> 
> The text reads "headers", alas there only appears to be one right now?
> So "header is" (singular)?

Nice catch.  I didn't notice this plural/singular mismatch.  Hmm, I could do
this:

<p>Some C++ Standard Library headers have been changed to no longer include
other headers that were being used internally by the library.
As such, C++ programs that used standard library components without
including the right headers will no longer compile.
</p>
<p>
In particular, the following header is used less widely in libstdc++ and may
need to be included explicitly when compiling with GCC 15:
</p>
<ul>
<li> <code>&lt;cstdint&gt;</code>
  (for <code>std::int8_t</code>, <code>std::int32_t</code> etc.)
</li>
</ul>

Here I only change the second paragraph.  The logic behind this is that the
first paragraph introduces the problem, therefore speaks more generally and
uses plural.  Then the second paragraph speaks about the particular header in
question and uses singular.

Or I could do this:

<p>Some C++ Standard Library headers have been changed to no longer include the
<code>&lt;cstdint&gt;</code>/<code>&lt;stdint.h&gt;</code> header that was
being used internally by the library. As such, C++ programs that used standard
library components without including <code>&lt;cstdint&gt;</code> where needed
will no longer compile.
</p>

<!-- Switch to this formulation if there are more headers like this
<p>Some C++ Standard Library headers have been changed to no longer include
other headers that were being used internally by the library.
As such, C++ programs that used standard library components without
including the right headers will no longer compile.
</p>
<p>
The following headers are used less widely in libstdc++ and may need to
be included explicitly when compiling with GCC 15:
<ul>
<li> <code>&lt;cstdint&gt;</code>
  (for <code>std::int8_t</code>, <code>std::int32_t</code> etc.)
</li>
-->

Any opinion on these two options?

Cheers,
Filip Kastl
Jonathan Wakely Aug. 20, 2024, 1:37 p.m. UTC | #3
On Wed, 7 Aug 2024 at 08:09, Filip Kastl <fkastl@suse.cz> wrote:
>
> On Tue 2024-08-06 17:00:24, Gerald Pfeifer wrote:
> > > +<p>
> > > +The following headers are used less widely in libstdc++ and may need to

I like Gerald's suggestion to change this to "within libstdc++" as
that is more precise about that change.

> > > +be included explicitly when compiling with GCC 15:
> > > +<ul>
> > > +<li> <code>&lt;cstdint&gt;</code>
> > > +  (for <code>std::int8_t</code>, <code>std::int32_t</code> etc.)
> > > +</li>
> >
> > The text reads "headers", alas there only appears to be one right now?
> > So "header is" (singular)?
>
> Nice catch.  I didn't notice this plural/singular mismatch.  Hmm, I could do
> this:
>
> <p>Some C++ Standard Library headers have been changed to no longer include
> other headers that were being used internally by the library.
> As such, C++ programs that used standard library components without
> including the right headers will no longer compile.
> </p>
> <p>
> In particular, the following header is used less widely in libstdc++ and may
> need to be included explicitly when compiling with GCC 15:
> </p>
> <ul>
> <li> <code>&lt;cstdint&gt;</code>
>   (for <code>std::int8_t</code>, <code>std::int32_t</code> etc.)
> </li>
> </ul>
>
> Here I only change the second paragraph.  The logic behind this is that the
> first paragraph introduces the problem, therefore speaks more generally and
> uses plural.  Then the second paragraph speaks about the particular header in
> question and uses singular.
>
> Or I could do this:
>
> <p>Some C++ Standard Library headers have been changed to no longer include the
> <code>&lt;cstdint&gt;</code>/<code>&lt;stdint.h&gt;</code> header that was
> being used internally by the library. As such, C++ programs that used standard
> library components without including <code>&lt;cstdint&gt;</code> where needed
> will no longer compile.
> </p>
>
> <!-- Switch to this formulation if there are more headers like this
> <p>Some C++ Standard Library headers have been changed to no longer include
> other headers that were being used internally by the library.
> As such, C++ programs that used standard library components without
> including the right headers will no longer compile.
> </p>
> <p>
> The following headers are used less widely in libstdc++ and may need to
> be included explicitly when compiling with GCC 15:
> <ul>
> <li> <code>&lt;cstdint&gt;</code>
>   (for <code>std::int8_t</code>, <code>std::int32_t</code> etc.)
> </li>
> -->
>
> Any opinion on these two options?

There might be more changes for GCC 15 that require additions here, so
I'd suggest the first form, as it's simpler to just add a new <li> for
other headers, rather than rewrite the paragraph that talks about
cstdint inline.
diff mbox series

Patch

diff --git a/htdocs/gcc-15/changes.html b/htdocs/gcc-15/changes.html
index bfd98496..0d2c0aaf 100644
--- a/htdocs/gcc-15/changes.html
+++ b/htdocs/gcc-15/changes.html
@@ -17,9 +17,8 @@ 
 <p>
 This page is a "brief" summary of some of the huge number of improvements
 in GCC 15.
-<!--
 You may also want to check out our
-<a href="porting_to.html">Porting to GCC 15</a> page and the
+<a href="porting_to.html">Porting to GCC 15</a> page <!-- and the
 <a href="../onlinedocs/index.html#current">full GCC documentation</a>.
 -->
 </p>
diff --git a/htdocs/gcc-15/porting_to.html b/htdocs/gcc-15/porting_to.html
new file mode 100644
index 00000000..43c3b302
--- /dev/null
+++ b/htdocs/gcc-15/porting_to.html
@@ -0,0 +1,53 @@ 
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Porting to GCC 15</title>
+<link rel="stylesheet" type="text/css" href="https://gcc.gnu.org/gcc.css">
+</head>
+
+<body>
+<h1>Porting to GCC 15</h1>
+
+<p>
+The GCC 15 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 15. This document is an effort to identify common issues
+and provide solutions. Let us know if you have suggestions for improvements!
+</p>
+
+<p>Note: GCC 15 has not been released yet, so this document is
+a work-in-progress.</p>
+
+<!-- <h2 id="c">C language issues</h2> -->
+
+<h2 id="cxx">C++ language issues</h2>
+
+<h3 id="header-dep-changes">Header dependency changes</h3>
+<p>Some C++ Standard Library headers have been changed to no longer include
+other headers that were being used internally by the library.
+As such, C++ programs that used standard library components without
+including the right headers will no longer compile.
+</p>
+<p>
+The following headers are used less widely in libstdc++ and may need to
+be included explicitly when compiling with GCC 15:
+</p>
+<ul>
+<li> <code>&lt;cstdint&gt;</code>
+  (for <code>std::int8_t</code>, <code>std::int32_t</code> etc.)
+</li>
+</ul>
+
+<!-- <h2 id="fortran">Fortran language issues</h2> -->
+
+</body>
+</html>