www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - "type qualifiers and static ..." error

↑ ↓ ← "W這dzimierz Skiba" <abx abx.art.pl> writes:
Compiling source here I found dm c++ returns error for some specific 
syntax:

static void Func(...)
{
  ...
  VECTOR const& E = Superellipsoid->Power;
                  ^
  source\super.cpp(480) : Error: type qualifiers and static can only appear   
  in outermost array of function parameter

This construction compiled fine with gcc (various ports), intel c++, visual
c++, 
borland c++ and two mac compilers. But error appeared in Digital Mars C++. 
Intentional or accidental ? Any idea ? I already solved it own way but I report
it 
here in case it can be a bug. VECTOR type is as follow:

#define DBL double
typedef DBL VECTOR[3];

Do you need more informations ?

ABX
Jan 21 2003
↑ ↓ "Walter" <walter digitalmars.com> writes:
I fixed a similar problem in the latest beta. Try it and see if the problem
goes away, if not, a small reproducible example showing the problem would be
nice. -Walter

"W這dzimierz Skiba" <abx abx.art.pl> wrote in message
news:b0j4l9$2e0c$1 digitaldaemon.com...
 Compiling source here I found dm c++ returns error for some specific
 syntax:

 static void Func(...)
 {
   ...
   VECTOR const& E = Superellipsoid->Power;
                   ^
   source\super.cpp(480) : Error: type qualifiers and static can only

   in outermost array of function parameter

 This construction compiled fine with gcc (various ports), intel c++,

 borland c++ and two mac compilers. But error appeared in Digital Mars C++.
 Intentional or accidental ? Any idea ? I already solved it own way but I

 here in case it can be a bug. VECTOR type is as follow:

 #define DBL double
 typedef DBL VECTOR[3];

 Do you need more informations ?

 ABX

Jan 21 2003
↑ ↓ "W這dzimierz Skiba" <abx abx.art.pl> writes:
"Walter" <walter digitalmars.com> wrote in
news:b0j4pn$2e78$1 digitaldaemon.com: 

 I fixed a similar problem in the latest beta. Try it and see if the
 problem goes away, if not, a small reproducible example showing the
 problem would be nice. -Walter

Ok. I have tested latest beta and the problem is still there but error message is different: "need explicit cast to convert". Here is small code similiar to original file as much as possible: typedef double VECTOR[3]; typedef struct Object_Struct OBJECT; struct Object_Struct { VECTOR Power; }; static void Superellipsoid_Normal(OBJECT *Object) { VECTOR const& E = Object->Power; } and here is command and output: sc -c source\super.cpp -odmdos\obj\src\super.obj -mn -6 -ff -WA -Ae VECTOR const& E = Object->Power; ^ source\super.cpp(11) : Error: need explicit cast to convert from: double ** to : double [const 3]* Above small code is still correctly compiled with other compilers. Should I additionally make posting follow http://www.digitalmars.com/bugs.html ? ABX
Jan 22 2003
↑ ↓ → "Walter" <walter digitalmars.com> writes:
I can take it from  here. Thanks! -Walter

"W這dzimierz Skiba" <abx abx.art.pl> wrote in message
news:b0m85a$14pq$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in
 news:b0j4pn$2e78$1 digitaldaemon.com:

 I fixed a similar problem in the latest beta. Try it and see if the
 problem goes away, if not, a small reproducible example showing the
 problem would be nice. -Walter

Ok. I have tested latest beta and the problem is still there but error

 different: "need explicit cast to convert". Here is small code similiar to

 file as much as possible:


     typedef double VECTOR[3];
     typedef struct Object_Struct OBJECT;

     struct Object_Struct
     {
       VECTOR Power;
     };

     static void Superellipsoid_Normal(OBJECT *Object)
     {
       VECTOR const& E = Object->Power;
     }

 and here is command and output:

   sc -c source\super.cpp -odmdos\obj\src\super.obj -mn -6 -ff -WA -Ae
     VECTOR const& E = Object->Power;
                                    ^
   source\super.cpp(11) : Error: need explicit cast to convert
   from: double **
   to  : double [const 3]*

 Above small code is still correctly compiled with other compilers.
 Should I additionally make posting follow

 ABX

Jan 22 2003