From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10256 invoked by alias); 5 May 2011 22:47:52 -0000 Received: (qmail 10244 invoked by uid 22791); 5 May 2011 22:47:51 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 May 2011 22:47:37 +0000 From: "paolo.carlini at oracle dot com" 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) X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: paolo.carlini at oracle dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 05 May 2011 22:47:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg00491.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48891 --- Comment #4 from Paolo Carlini 2011-05-05 22:46:39 UTC --- Just wanted to add that the real reason the issue is more subtle now in C++0x mode than it used to be (and still is) in C++03 mode as an extension, is that we now provide the functions in namespace std with the mandated return type, that is bool, whereas in C++03 mode, as an extension, the return type is int, like in C99. Frankly, *given* the usual, well known, limits of our way of dealing with the underlying *.h C headers (included as implementation detail anyway), I don't see any reasonably simple way of solving this family of problems. Actually, anyway, modulo a C++ front-end issue I filed some time ago, I think the header isn't *that* far from dispensing with including math.h, the most important blocking issue being the constants FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, which, the last time I asked, Joseph, if I remember correctly, said are very tricky to obtain outside math.h... Anyway, given the different return types in C++0x and C99, the problem would resurface quite unavoidably with: #include #include using namespace std; of course, if we only fix still without fully controlling math.h. Don't hold your breath ;)