public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25940]  New: multiple definitions of extern "C" functions
@ 2006-01-24  8:31 wolfgang dot roehrl at gi-de dot com
  2006-01-24 12:40 ` [Bug c++/25940] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: wolfgang dot roehrl at gi-de dot com @ 2006-01-24  8:31 UTC (permalink / raw)
  To: gcc-bugs

Dear all,

I would like to post a bug report for the GNU C/C++ compiler 3.3-e500.

We use the compiler to generate code for a PowerPC processor.

Used invokation line for the GNU C++ compiler:

ccppc -c -x c++ -ansi -Wall -Werror -mcpu=8540 -fverbose-asm -mbig
      -fmerge-templates -mmultiple -mno-string -mstrict-align -O3
      -fno-exceptions -fno-rtti -fno-builtin-printf
      -I<different include paths>
      -D<differen #define's>
      X.CPP -oX.O


// file X.CPP

namespace N1 {

extern "C" int func (int);

}


namespace N2 {

extern "C" int func (int);

}


namespace N3 {

extern "C" int func (int);

int func (int i) { return i * 2; }        // <--- definition of func()

}


int N1::func (int i) { return i / 2; }    // <--- func() already defined!


namespace N2 {

int func (int i) { return i + 2; }        // <--- func() already defined!

}


The compiler accepts this program and generates illegal assembler code:
the label 'func' is defined three times as a global symbol.

According to 7.5/6 the compiler should reject the program since func() is
defined three times (see also 7.3.4/4).


Kind regards
W. Roehrl


-- 
           Summary: multiple definitions of extern "C" functions
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wolfgang dot roehrl at gi-de dot com
 GCC build triplet: sparc-sun-solaris2.5.1
  GCC host triplet: i386-pc-mingw32
GCC target triplet: powerpc-wrs-vxworks


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25940


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/25940] multiple definitions of extern "C" functions
  2006-01-24  8:31 [Bug c++/25940] New: multiple definitions of extern "C" functions wolfgang dot roehrl at gi-de dot com
@ 2006-01-24 12:40 ` pinskia at gcc dot gnu dot org
  2006-01-25 10:53 ` rguenth at gcc dot gnu dot org
  2006-02-01 18:16 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-24 12:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-01-24 12:40 -------
Confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-01-24 12:40:37
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25940


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/25940] multiple definitions of extern "C" functions
  2006-01-24  8:31 [Bug c++/25940] New: multiple definitions of extern "C" functions wolfgang dot roehrl at gi-de dot com
  2006-01-24 12:40 ` [Bug c++/25940] " pinskia at gcc dot gnu dot org
@ 2006-01-25 10:53 ` rguenth at gcc dot gnu dot org
  2006-02-01 18:16 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-01-25 10:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2006-01-25 10:52 -------
Shorter testcase:

namespace N1 {
  extern "C" int func (int);
  int func (int) {}
};
namespace N2 {
  extern "C" int func (int);
  int func (int) {}
};

not a regression from anything.  Not dependent on weird cross configuration.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  GCC build triplet|sparc-sun-solaris2.5.1      |
   GCC host triplet|i386-pc-mingw32             |
 GCC target triplet|powerpc-wrs-vxworks         |
      Known to fail|                            |3.4.5 4.0.2 4.1.0 4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25940


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/25940] multiple definitions of extern "C" functions
  2006-01-24  8:31 [Bug c++/25940] New: multiple definitions of extern "C" functions wolfgang dot roehrl at gi-de dot com
  2006-01-24 12:40 ` [Bug c++/25940] " pinskia at gcc dot gnu dot org
  2006-01-25 10:53 ` rguenth at gcc dot gnu dot org
@ 2006-02-01 18:16 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-01 18:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-02-01 18:15 -------
Related closely to PR 13699.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |13699


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25940


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/25940] multiple definitions of extern "C" functions
       [not found] <bug-25940-4@http.gcc.gnu.org/bugzilla/>
@ 2014-11-07  0:15 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-11-07  0:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25940

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nlewycky at google dot com

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 63769 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-07  0:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-24  8:31 [Bug c++/25940] New: multiple definitions of extern "C" functions wolfgang dot roehrl at gi-de dot com
2006-01-24 12:40 ` [Bug c++/25940] " pinskia at gcc dot gnu dot org
2006-01-25 10:53 ` rguenth at gcc dot gnu dot org
2006-02-01 18:16 ` pinskia at gcc dot gnu dot org
     [not found] <bug-25940-4@http.gcc.gnu.org/bugzilla/>
2014-11-07  0:15 ` pinskia at gcc dot gnu.org

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).