public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marc.glisse at normalesup dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/48891] std functions conflicts with C functions when building with c++0x support (and using namespace std) Date: Sun, 29 Apr 2012 13:17:00 -0000 [thread overview] Message-ID: <bug-48891-4-z9GuQHSZUR@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-48891-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891 --- Comment #6 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-29 13:15:40 UTC --- I don't think it matters that much whether the return type is int or bool, compared to the inconvenience of having 2 functions that conflict. The constexpr qualifier is nice, but not required by the standard, and not even by gcc which recognizes that extern "C" int isnan(double) is a builtin (note that it doesn't recognize it anymore if you change the return type to bool, that should be fixed). For the same reason (recognized as a builtin), there is no performance advantage to having it inline. So I think: * glibc could change the return type of isnan to bool in C++ (there would be a regression in that ::isnan wouldn't be constexpr and inline until g++ is taught the right prototype) * libstdc++ could import ::isnan in std::, assuming isnan exists. Maybe that requires a configure test. Maybe that test would be rather fragile (depends on feature macros). Maybe that's where this stops being a good idea :-(
next prev parent reply other threads:[~2012-04-29 13:17 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-05-05 21:50 [Bug libstdc++/48891] New: std functions conflicts with C functions when building with c++0x support alexis.menard at openbossa dot org 2011-05-05 21:44 ` [Bug libstdc++/48891] " alexis.menard at openbossa dot org 2011-05-05 22:08 ` [Bug libstdc++/48891] std functions conflicts with C functions when building with c++0x support (and using namespace std) redi at gcc dot gnu.org 2011-05-05 22:22 ` alexis.menard at openbossa dot org 2011-05-05 22:47 ` paolo.carlini at oracle dot com 2011-05-05 23:16 ` paolo.carlini at oracle dot com 2012-04-29 13:17 ` marc.glisse at normalesup dot org [this message] 2015-04-09 14:35 ` 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-48891-4-z9GuQHSZUR@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: linkBe 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).