public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: O.Kullmann@Swansea.ac.uk To: gcc-gnats@gcc.gnu.org Subject: c++/10112: static data member is not correctly initialised Date: Sun, 16 Mar 2003 20:06:00 -0000 [thread overview] Message-ID: <20030316200425.30546.qmail@sources.redhat.com> (raw) >Number: 10112 >Category: c++ >Synopsis: static data member is not correctly initialised >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Sun Mar 16 20:06:02 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Oliver Kullmann >Release: gcc 3.2.1 >Organization: >Environment: > g++ -v Reading specs from /compsci/partition1/csoliver/GCC/gcc-3.2.1/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/specs Configured with: /compsci/partition1/csoliver/GCC/gcc-3.2.1/configure --enable-threads=posix --enable-long-long --prefix=/compsci/partition1/csoliver/GCC/gcc-3.2.1 --with-local-prefix=/compsci/partition1/csoliver/GCC/Include_3.2.1 --enable-languages=c,c++ --disable-nls --enable-shared Thread model: posix gcc version 3.2.1 >Description: When compiling the attached file (56 lines) with > g++ FehlerInit.cpp and running it I get > ./a.out -33630626 Speicherzugriffsfehler The first line in main LitIntOccInt::Var v; yields a call of the member function InfoPolicyVector<int>::new_variable() which prints out the iterator difference between centre and info_vector.begin(), where centre is a static data member initialised to info_vector.begin(), and thus the result should be 0, but as shown above, it is "undefined". The code given seems to be a minimal example (up to some typedefs) in the sense, that removing any other stuff (which seems completely unrelated to the above behaviour) changes the output to the correct "0". >How-To-Repeat: Compile and run. >Fix: I have no idea. It seems to me quite serious. P.S. Perhaps it would be a good idea to somehow improve the instructions for submitting a bug. For example I couldn't find an explanation of what the above abbreviations for the error class could mean. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/x-c++src; name="FehlerInit.cpp" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="FehlerInit.cpp" Ly8gT2xpdmVyIEt1bGx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UeXBlIEluZm9Qb2xpY3lWZWN0b3I8SW5kZXg+OjppbmZvX3ZlY3Rvcigx KTsKdGVtcGxhdGUgPHR5cGVuYW1lIEluZGV4Pgp0eXBlbmFtZSBJbmZvUG9saWN5VmVjdG9yPElu ZGV4Pjo6SW5mb1ZlY3RvclR5cGU6Oml0ZXJhdG9yIEluZm9Qb2xpY3lWZWN0b3I8SW5kZXg+Ojpj ZW50cmUoaW5mb192ZWN0b3IuYmVnaW4oKSk7Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgSW5kZXgsIHRl bXBsYXRlIDx0eXBlbmFtZSBJbmRleD4gY2xhc3MgSW5mb1BvbGljeUxpdD4Kc3RydWN0IExpdGVy YWxzQXNJbnRlZ2VycyA6IEluZm9Qb2xpY3lMaXQ8SW5kZXg+IHsKICB0eXBlZGVmIFZhcmlhYmxl c0FzSW5kaWNlczx0eXBlbmFtZSBJbmZvUG9saWN5TGl0PEluZGV4Pjo6TGluayA+IFZhcjsKICB0 eXBlbmFtZSBJbmZvUG9saWN5TGl0PEluZGV4Pjo6SW5mb1JlZmVyZW5jZVR5cGUgb3BlcmF0b3Ig KigpIGNvbnN0IHsKICAgIHJldHVybiBnZXRfaW5mbygwKTsKICB9Cn07Cgp0eXBlZGVmIExpdGVy YWxzQXNJbnRlZ2VyczxpbnQsIEluZm9Qb2xpY3lWZWN0b3I+IExpdEludE9jY0ludDsKCmludCBt YWluKCkgewogIExpdEludE9jY0ludDo6VmFyIHY7CiAgTGl0SW50T2NjSW50IHk7CiAgKCp5KS5w b3MgPSA3Owp9Cg==
next reply other threads:[~2003-03-16 20:06 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-03-16 20:06 O.Kullmann [this message] 2003-03-16 22:26 Giovanni Bajo 2003-03-17 12:04 nathan 2003-03-17 18:56 Oliver Kullmann
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=20030316200425.30546.qmail@sources.redhat.com \ --to=o.kullmann@swansea.ac.uk \ --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).