public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/53673] Add magic weak symbol to indicate C++ standard setting (C++03, C++11 etc) to help debug ABI problems
Date: Fri, 15 Jun 2012 17:47:00 -0000	[thread overview]
Message-ID: <bug-53673-4-Kc7kJ51Dug@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53673-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53673

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-06-15 17:46:51 UTC ---
(In reply to comment #6)
> Technically, you could add it to the top of <stddef.h> or whatever is a
> guaranteed included library header:

libstdc++'s <bits/c++config.h> would be the right place and as part of the std
lib the symbol should probably be named __glibcxx_blah

I think you'd also need an actual definition or nothing will be emitted for the
declaration alone:

#if __GXX_WEAK__
#if __cplusplus == 201103L
extern "C" void __glibcxx_std_cxx11() __attribute__((weak));
extern "C" void __glibcxx_std_cxx11() { }
#else if __cplusplus == 199711L
extern "C" void __glibcxx_std_cxx98() __attribute__((weak));
extern "C" void __glibcxx_std_cxx98() { }
#else
#warning Unknown C++ standard version
#endif
#endif


> No, it's fair enough, I only know that from watching the discussions on ISO and
> I have no idea if it's actually written in the final published standard. It is
> however written in Nicolai Josuttis' updated C++11 "The C++ standard library"
> in the chapter on C++11 core language changes. And if you think it through,
> there has to be in practice ABI breakage in 03 ABIs because no one could have
> anticipated during their design of what 11 would require [1].
> 
> [1]: This may not apply to GCC as it revised its ABI quite recently, and I'm
> sure its designers took into account likely future 11 requirements.

The current G++ ABI is eight years old and (modulo bugs) the same for c++98 and
c++11, see Bug 53646 comment 17

Again, the incompatibilities are in the library not the core language.
Whether that's generally true for other compilers is irrelevant here.


  parent reply	other threads:[~2012-06-15 17:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 16:36 [Bug c++/53673] New: " s_gccbugzilla at nedprod dot com
2012-06-14 17:22 ` [Bug c++/53673] " redi at gcc dot gnu.org
2012-06-14 20:06 ` pluto at agmk dot net
2012-06-15 15:14 ` s_gccbugzilla at nedprod dot com
2012-06-15 15:23 ` s_gccbugzilla at nedprod dot com
2012-06-15 15:38 ` redi at gcc dot gnu.org
2012-06-15 16:53 ` s_gccbugzilla at nedprod dot com
2012-06-15 17:47 ` redi at gcc dot gnu.org [this message]
2012-06-16 14:19 ` [Bug libstdc++/53673] " s_gccbugzilla at nedprod dot com
2012-06-18  0:07 ` redi at gcc dot gnu.org
2012-06-18 10:01 ` s_gccbugzilla at nedprod dot com
2012-06-18 14:22 ` redi at gcc dot gnu.org

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=bug-53673-4-Kc7kJ51Dug@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).