help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: small porting project turning into a big mess


From: Jeremy Littler
Subject: Re: small porting project turning into a big mess
Date: Fri, 8 Dec 2000 11:30:58 +0000

I have noticed a similar problem which may well be related.
The following code does not compile with g++  version 2.95.2 19991024 (release)

class classA_c
{
public:
  classA_c() {j = 0;};
  classA_c(int i) {j = i;};
  ~classA_c() {};

private:
  int j;
};

int main()
{
  typedef const classA_c pFredA[3][3];

  const classA_c theObjectA = classA_c(1);

  pFredA thePFredA2 = {{theObjectA, theObjectA, theObjectA},
                       {theObjectA, theObjectA, theObjectA},
                       {theObjectA, theObjectA, theObjectA}};
}

I get the following  errors reported from g++:

Remus% /usr/local/bin/g++ bug.cpp
bug.cpp: In function `int main()':
bug.cpp:20: conversion from `const classA_c[3]' to non-scalar type `classA_c' 
requested
bug.cpp:20: conversion from `const classA_c[3]' to non-scalar type `classA_c' 
requested
bug.cpp:20: conversion from `const classA_c[3]' to non-scalar type `classA_c' 
requested

I have not found a solution to this though, earlier versions of g++ did not have
a problem with this code. version egcs-2.91.66 does not generate these problems.

Jeremy


On Thu, 07 Dec 2000, Donald Brinkman wrote:
> Hello all . . .
> 
> I have been given the task of porting a small project from an IRIX
> environment into a visual c++ compatible library.  To accomplish this I
> decided to use Cygwin, since it has such nice utilities for creating DLLs.
> Everything has been going fine, with only a few changes here and there,
> until I stopped dead on this problem.  Given the member function:
> 
> const Foo** FooBar::getA() const
>         {
>         return ( A )
>         }
> 
> where A is a const Foo** 
> 
> I get the following message:
> 
> Return to const Foo** from Foo **const adds cv-quals without intervening
> 'const'.
> 
> 
> Now, please, can someone tell me just what a cv-qual is and why the compiler 
> complains about this on Cygwin but not IRIX? Any help would be greatly
> appreciated.
> 
> Donald Brinkman
> George H. Lindquist
> OptiMetrics, Inc.
> 3115 Professional Drive
> Ann Arbor, MI 48104
> Voice phone: 734-973-1177 ext 219
> Fax: 734-973-1177 ext 227
> 
> 
> _______________________________________________
> Help-gplusplus mailing list
> Help-gplusplus@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gplusplus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]