public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Kiril Vidimce <
To: nobody@gcc
Cc: gcc-prs@gcc.gnu.
Subject: Re: c/2397: big char array causes segfault
Date: Mon, 26 Mar 2001 20:16:00 -0000	[thread overview]
Message-ID: <20010327041601.7516.qmail@sourceware.cygnus.com> (raw)

The following reply was made to PR c/2397; it 
>From snyder@fnal.gov Mon Mar 26 21:46:00 2001
From: snyder@fnal.gov
To: gcc-gnats@gcc.gnu.org
Subject: c++/2398: external name gets put in wrong namespace
Date: Mon, 26 Mar 2001 21:46:00 -0000
Message-id: <200103270538.f2R5ctu30354@karma.fnal.gov>
X-SW-Source: 2001-03/msg00287.html
Content-length: 2519

>Number:         2398
>Category:       c++
>Synopsis:       external name gets put in wrong namespace
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 26 21:46:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     scott snyder
>Release:        3.0 20010326 (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:

If i compile the source below and look at the generated code, i see
that the reference to the rcp::EntryRCPID constructor is said to be
in the global namespace, _not_ the rcp namespace.

If the typedef is removed, then the external reference moves back
to the rcp namespace.  Oddly, if the EntryRCPID class is made non-virtual
by removing the destructor declaration, and if i turn on debugging,
then the external name also moves back to the rcp namespace.

>How-To-Repeat:

---------------------------------------------------------------------
namespace rcp {

struct EntryRCPID
{
  EntryRCPID();
  virtual ~EntryRCPID();
};

typedef EntryRCPID                  EntryRCPID;

}

void xyzzy()
{
  rcp::EntryRCPID x;
}

---------------------------------------------------------------------


$ ./cc1plus -quiet x.cc
$ c++filt < x.s | grep EntryRCPID
        call    EntryRCPID::EntryRCPID()
        call    EntryRCPID::~EntryRCPID()

If i comment out the destructor declaration in the above and add -g
to the compilation, i get instead the following results:

$ ./cc1plus -g -quiet x.cc
$ c++filt  < x.s | grep EntryRCPID
        .stabs  "EntryRCPID:T(0,25)=s1operator=::(0,26)=#(0,25),(0,27)=&(0,25),(0,28)=*(0,25),(0,29)=&(0,25),(0,21);:rcp::EntryRCPID::operator=(rcp::EntryRCPID const&);2A.;__base_ctor::(0,30)=#(0,25),(0,21),(0,28),(0,29),(0,21);:rcp::EntryRCPID::EntryRCPID(rcp::EntryRCPID const&);2A.;__comp_ctor::(0,30):rcp::EntryRCPID::EntryRCPID(rcp::EntryRCPID const&);2A.;__base_ctor::(0,31)=#(0,25),(0,21),(0,28),(0,21);:rcp::EntryRCPID::EntryRCPID();2A.;__comp_ctor::(0,31):rcp::EntryRCPID::EntryRCPID();2A.;;",128,0,0,0
        .stabs  "EntryRCPID:Tt(0,25)",128,0,4,0
        call    rcp::EntryRCPID::EntryRCPID()


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


             reply	other threads:[~2001-03-26 20:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-26 20:16 Kiril Vidimce [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-06-07 14:07 pme
2001-03-28 13:16 Kiril Vidimce
2001-03-26 19:56 vkire

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=20010327041601.7516.qmail@sourceware.cygnus.com \
    --to=nobody@gcc \
    --cc=gcc-prs@gcc.gnu. \
    /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).