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-1.1b -- typedef type array[] in a class fails


Hello,

I think I have found another bug in egcs-1.1b
  gcc -v: gcc version egcs-2.91.57 19980901 (egcs-1.1 release)

Inside a class, it is not possible to make a type "array of
something".

Here comes a short example:

save this as "array.cc"
--- snip -------------------------------------------------------------
typedef int Array1[];
static Array1 array1 = { 1, 2, 3};

class Test
{
public:
  typedef int Array2[];
  typedef int Array3;
};
static Test::Array2 array2 = { 1, 2, 3};

// later on I will use this type to use as argument
void func (Array1 a) {}

// with the alternative form I have to use
// and this is not what I want to do
void func2 (Test::Array3 a[]) {}
--- snip -------------------------------------------------------------


	g++ -c -Wall array.cc
gives

array.cc:7: pointer/reference to array of unknown bound in parm type
array.cc:2: warning: `int array1[3]' defined but not used
array.cc:10: warning: `int array2[3]' defined but not used

The warnings show, that beside the error message the code was
interpreted correctly. But the error stops the compilation :-((

My system:
  pentium-100
  64 MByte RAM
  egcs-2.91.57 19980901 (egcs-1.1 release)
  linux-2.0.34
  libc.so.5.4.44

egcs was compiled with the following commandlines:

  cd egcs-objdir
  ../egcs-1.1a/configure --prefix=/usr/egcs-1.1a --enable-shared \
    --enable-version-specific-runtime-libs
  time make CFLAGS='-O' LIBCFLAGS='-g -O2' LIBCXXFLAGS='-g -O2 \
    -fno-implicit-templates' bootstrap

I discovered this bug while compiling Edinburgh-Speech-Tools v1.1.0

Hopefully I have included all necessary information.

Best wishes and thanks for all your work
  Uwe Koloska


-- 
mailto:koloska@rcs.urz.tu-dresden.de
http://rcswww.urz.tu-dresden.de/~koloska/
--                                    --
right now the web page is in german only
but this will change as time goes by ;-)


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