This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bug in egcs-2.91.66


Hallo,

compiling the following source with the g++ (version egcs-2.91.66) produces an
undefined reference with a wrong dimensioned parameter:


    typedef int (*Type)[3];

    class A {
    public:
      A( Type );
    };

    int main () {
      int d[3] = {1,2,3};
      Type t = &d;
      A a( t );
      return 0;
    }


Of course, when compiling and linking this source, the linker has to
fail because of the missing reference to A::A(...), but the linker
produce to following output:

    /usr/tmp/ccGzquPM.o: In function `main':
    /usr/tmp/ccGzquPM.o(.text+0xb): undefined reference to `A::A(int (*)[2])'

instead of (produce by a egcs-2.90.29 980515 (egcs-1.0.3 release)):

    /usr/tmp/cca324731.o: In function `main':
    /usr/tmp/cca324731.o(.text+0xb): undefined reference to `A::A(int (*)[3])'

The dimension of the parameter  is 'reduced' from `A::A(int (*)[3])' to
`A::A(int (*)[2])' by the new compiler.

Thanks for help,
	Joern Beutner

--
Technische Universitaet Berlin, Germany


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]