From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12570 invoked by alias); 15 Jul 2002 14:46:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 12541 invoked by uid 71); 15 Jul 2002 14:46:01 -0000 Resent-Date: 15 Jul 2002 14:46:01 -0000 Resent-Message-ID: <20020715144601.12540.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, juberti@aol.com, fleming@apple.com, mikest@apple.com Resent-Reply-To: gcc-gnats@gcc.gnu.org, sethjschroeder@aol.com Received: (qmail 8130 invoked by uid 61); 15 Jul 2002 14:40:38 -0000 Message-Id: <20020715144038.8129.qmail@sources.redhat.com> Date: Mon, 15 Jul 2002 07:46:00 -0000 From: sethjschroeder@aol.com Reply-To: sethjschroeder@aol.com To: gcc-gnats@gcc.gnu.org Cc: juberti@aol.com, fleming@apple.com, mikest@apple.com X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify: juberti@aol.com, fleming@apple.com, mikest@apple.com Subject: c++/7313: variable declared but not defined with "C" linkage placed in enclosing namespace at link time X-SW-Source: 2002-07/txt/msg00464.txt.bz2 List-Id: >Number: 7313 >Category: c++ >Synopsis: variable declared but not defined with "C" linkage placed in enclosing namespace at link time >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Mon Jul 15 07:46:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Seth Schroeder >Release: Apple Computer, Inc. GCC version 1040, based on gcc version 3.1 20020105 (experimental) >Organization: >Environment: seths% gcc -v Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs Thread model: posix Apple Computer, Inc. GCC version 1040, based on gcc version 3.1 20020105 (experimental) seths% uname -a Darwin localhost 6.0 Darwin Kernel Version 6.0: Wed May 1 01:04:14 PDT 2002; root:xnu/xnu-282.obj~4/RELEASE_PPC Power Macintosh powerpc OS X 10.2 beta build. Problem also occurs on release candidate build of OS. >Description: command line: g++ -Wall -c mismatch.cpp compiler messages: (none) The problem is that at link time, variables declared with "C" linkage but not defined with it are placed in the enclosing namespace, instead of the global namespace. This does not happen with g++ 2.96 (stock rh 7.3 flavor) or HP-UX 11.22's aCC. Nor does it happen with functions. >How-To-Repeat: see attachment >Fix: Place all explicitly-namespaced variables declared with "C" linkage in global namespace at link time. >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/x-gzip; name="mismatch.ii.gz" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="mismatch.ii.gz" H4sICH3dMj0CA21pc21hdGNoLmlpAG2MQQrCMBBF9znFJ93ookLXUTeeJI0jDnQmIU2hWHp3I1hQ 6F++z3sNOljhUXwJz1NIyZrmg879xENpWa8bCFHE6x0DK23wX1QvNCYfCI8YzWJQR3OhrLA3C9aC 3me3z1+HozOr2Y18TVzQdu6HVAcLMpWppuqFtRbecOI1NdIAAAA=