public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: dmuell@gmx.net
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/2989: libstdc++ breaks compilation of strcpy
Date: Tue, 29 May 2001 05:56:00 -0000	[thread overview]
Message-ID: <200105291249.f4TCndW26197@rotes20.wohnheim.uni-kl.de> (raw)

>Number:         2989
>Category:       libstdc++
>Synopsis:       ambiguous overload of strcpy when including iostream
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue May 29 05:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Dirk A. Mueller
>Release:        3.0 20010529 (prerelease)
>Organization:
>Environment:
System: Linux 2.4.4
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../configure --enable-languages=c,c++ --enable-shared --enable-threads --enable-c99 --enable-long-long
>Description:

this code does no longer compile: 

=== Cut ===
#include <string.h>
#include <iostream>

using namespace std;

int main() {
  char foo[300];
  char* bar = "foo";

  strcpy(foo, bar);
}
=== Cut ===

the error message is: 

 call of overloaded `strcpy(char[300], char*&)' is ambiguous
/usr/include/string.h:78: candidates are: char* strcpy(char*, const char*)
/usr/local/include/g++-v3/bits/std_cstring.h:104:                 char* 
   std::strcpy(char*, const char*)

it worked fine with the gcc of a few days ago and with gcc 2.95.3 as all
previous releases (of course, as they didn't handle namespace conflicts)

>How-To-Repeat:
>Fix:

none known except removing the "using namespace" directive. 

>Release-Note:
>Audit-Trail:
>Unformatted:


                 reply	other threads:[~2001-05-29  5:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200105291249.f4TCndW26197@rotes20.wohnheim.uni-kl.de \
    --to=dmuell@gmx.net \
    --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: 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).