public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: marc-oliver.gewaltig@hre-ftr.f.rd.honda.co.jp
To: gcc-gnats@gcc.gnu.org
Subject: c++/6257: C-library symbols enter global namespace
Date: Thu, 11 Apr 2002 09:26:00 -0000	[thread overview]
Message-ID: <20020411161658.10999.qmail@sources.redhat.com> (raw)


>Number:         6257
>Category:       c++
>Synopsis:       C-library symbols enter global namespace
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 11 09:26:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     marc-oliver.gewaltig@hre-ftr.f.rd.honda.co.jp
>Release:        unknown-1.0
>Organization:
>Environment:
Linux (Suse 6.2), Solaris 8, probably all
>Description:
The C++ standard states that 
- all C++ header files define their symbols in namespace std
- all C header files, used in the form <c*> define their symbol in
  namespace std (Annex D 5.2,3).

However, g++ puts C symbols in the global namespace,
even if included via <c**> headers.

>How-To-Repeat:
The following version of hello-world should NOT compile
with an ISO-14882 compliant compiler

#include <cstdio>

int main()
{
  // should not work, because printf is in std::
  printf("Hello world.\n");

  return 0;
}
>Fix:
Put all C symbols in the namespace std, if included
by <c*> headers.
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-04-11 16:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-11  9:26 marc-oliver.gewaltig [this message]
2002-04-11 12:36 Phil Edwards
2002-04-12  0:46 Marc-Oliver Gewaltig
2002-04-25 13:56 Phil Edwards

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=20020411161658.10999.qmail@sources.redhat.com \
    --to=marc-oliver.gewaltig@hre-ftr.f.rd.honda.co.jp \
    --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).