public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: snyder@fnal.gov To: gcc-gnats@gcc.gnu.org Subject: libstdc++/2977: string.h doesn't always inject names into std:: Date: Sun, 27 May 2001 22:06:00 -0000 [thread overview] Message-ID: <200105280459.f4S4xAj12301@karma.fnal.gov> (raw) >Number: 2977 >Category: libstdc++ >Synopsis: string.h doesn't always inject names into std:: >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Sun May 27 22:06:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: scott snyder >Release: 3.0 20010525 (prerelease) >Organization: >Environment: System: Linux karma 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../egcs/configure --prefix=/usr/local/egcs --enable-threads=posix --enable-long-long >Description: The program below doesn't compile: it appears that when used after an #include <cstring>, then #include <string.h> doesn't get the names injected into std::, as required by the standard. gcc 2.95 compiles the example below without complaint, so this could be considered a regression. Reversing the order of the inclusions below makes the example compile, as does adding a `using namespace std;'. (Note, however, that if one does _both_ of these, one gets a complaint about an ambiguous call to strchr.) >How-To-Repeat: -------------------------------------------------------------------------- #include <cstring> #include <string.h> const char* foo (const char* s) { return strchr (s, 'a'); } -------------------------------------------------------------------------- $ g++ -c x.cc x.cc: In function `const char* foo(const char*)': x.cc:6: `strchr' undeclared (first use this function) x.cc:6: (Each undeclared identifier is reported only once for each function it appears in.) >Fix: >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2001-05-27 22:06 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-05-27 22:06 snyder [this message] 2001-06-11 16:21 bkoz
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=200105280459.f4S4xAj12301@karma.fnal.gov \ --to=snyder@fnal.gov \ --cc=gcc-gnats@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).