public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "o dot kullmann at swansea dot ac dot uk" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/19279] New: wrong code due to name import from the implementation of the standard library Date: Wed, 05 Jan 2005 20:17:00 -0000 [thread overview] Message-ID: <20050105201727.19279.o.kullmann@swansea.ac.uk> (raw) For example with #include <vector> #include <cassert> double close(double) { return 1239; } int main() { assert(close(10) == 1239); } which should run without asserting, actually the assert fails. The reason is that <vector> includes /usr/include/unistd.h which defines int close(int) and which is preferred over the above version of close. The above code is just a trivial example for wrong code produced by g++; in my code is was much harder to find the problem, and actually anything can happen with "close" and likely many other names included by the implementation of the standard library. I consider this bug as very serious (it can ruin any perfectly valid program). Of course, once you know the problem for this name, you can work around it, but then g++ is not a C++ compiler anymore, and how to know the critical names??? In the list of known bugs I couldn't find anything mentioned in the above direction, but it seems to me, that serious warnings must be posted. -- Summary: wrong code due to name import from the implementation of the standard library Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: critical Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: o dot kullmann at swansea dot ac dot uk CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19279
next reply other threads:[~2005-01-05 20:17 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-01-05 20:17 o dot kullmann at swansea dot ac dot uk [this message] 2005-01-05 20:25 ` [Bug c++/19279] " pinskia at gcc dot gnu dot org 2005-01-05 21:17 ` gdr at integrable-solutions dot net
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=20050105201727.19279.o.kullmann@swansea.ac.uk \ --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).