Thread overview
"type qualifiers and static ..." error
Jan 21, 2003
W³odzimierz Skiba
Jan 21, 2003
Walter
Jan 22, 2003
W³odzimierz Skiba
Jan 22, 2003
Walter
January 21, 2003
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
January 21, 2003
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³odzimierz 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
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


January 22, 2003
"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
January 22, 2003
I can take it from  here. Thanks! -Walter

"W³odzimierz 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
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