public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: Andrew Pinski <apinski@marvell.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] GCC-13/changes: Add note about iostream usage
Date: Wed, 26 Apr 2023 12:10:20 -0700	[thread overview]
Message-ID: <CA+=Sn1nU=L_DRHcciwFoB8aeopfq03J1gFKqCi-753+Ts9bt-g@mail.gmail.com> (raw)
In-Reply-To: <ZEl2M+SrYjkUmyub@redhat.com>

On Wed, Apr 26, 2023 at 12:07 PM Jonathan Wakely via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On 26/04/23 09:53 -0700, Andrew Pinski wrote:
> >This adds a note about iostream usage so it does not catch others
> >in surpise like it has already.
> >
> >OK?
>
> Thanks, I agree we should add something, but have some comments below.
>
> >---
> > htdocs/gcc-13/changes.html | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> >diff --git a/htdocs/gcc-13/changes.html b/htdocs/gcc-13/changes.html
> >index 70732ec0..7c83f7c4 100644
> >--- a/htdocs/gcc-13/changes.html
> >+++ b/htdocs/gcc-13/changes.html
> >@@ -25,6 +25,11 @@ You may also want to check out our
> > <!-- .................................................................. -->
> > <h2>Caveats</h2>
> > <ul>
> >+    <li>libstdc++ uses constructors inside the library to initialize std::cout/std::cin, etc.
> >+     instead of having it done in each source which uses iostream header.
>
> We should use code font for std::cout, std::cin and iostream, and
> style it as <iostream> not just iostream.
>
> >+     This requires you to make sure the dynamic loader to load the new libstdc++v3 library
> >+     (examples of how to do this is to use -Wl,-rpath,... while linking or LD_LIBRARY_PATH
> >+     while running the program).  </li>
>
> I think it would be better to link to
> https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic
>
> How about:
>
>    <li>For C++, construction of the global iostream objects
>    <code>std::cout</code>, <code>std::cin</code> etc. is now done
>    inside the standard library, instead of in every source file that
>    includes the <code>&lt;iostream&gt;</code> header. This change
>    improves the start-up performance of C++ programs, but it means that
>    code compiled with GCC 13.1 will crash if the correct version of
>    <code>libstdc++.so</code> is not used at runtime. See the
>    <a href="https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dynamic_or_shared.html#manual.intro.using.linkage.dynamic">documentation</a>
>    about using the right <code>libstdc++.so</code> at runtime.
>    </li>

This looks better than my version.

Thanks,
Andrew

>
>

  reply	other threads:[~2023-04-26 19:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 16:53 Andrew Pinski
2023-04-26 19:06 ` Jonathan Wakely
2023-04-26 19:10   ` Andrew Pinski [this message]
2023-04-28 12:56   ` [PATCH v2] " Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+=Sn1nU=L_DRHcciwFoB8aeopfq03J1gFKqCi-753+Ts9bt-g@mail.gmail.com' \
    --to=pinskia@gmail.com \
    --cc=apinski@marvell.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).