[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 694
  • Last Modified:

Function argument assignment between types "struct dml_*" and "struct dml_**" is not allowed.

Hi Experts

I'm getting this problem when I compile my code:

Function argument assignment between types "struct dml_*" and "struct dml_**" is not allowed.
It doesnt fail to compile, so I guess its a warning rather than an error?
But what does it mean?

The line which is giving the error is:

 initDML(&dml);

and the dml structure is being passed as an argument to the function which that line is in...

struct dml_* is a pointer to the dml structure, but Im not sure what the ** means?

all help appriciated.
0
stummj
Asked:
stummj
1 Solution
 
sunnycoderCommented:
Hi stummj,

There is a strong possibility that this is indicative of an error

struct dml_ ** means pointer to pointer to struct dml

i.e. pointer to struct dml_ * would be of type struct dml_ **

Apparently, you are passing/assigning one type to another

>The line which is giving the error is:

> initDML(&dml);
what is the prototype for initDML and what is the type for dml?

Cheers!
Sunnycoder
0
 
stummjAuthor Commented:
Thanks Sunny. I changed it to intDML(dml) and its fine (well its core dumping but that wil be a different problem that Im looking at next. Its compiling without error)
0
 
vjs08Commented:
Hi
Start from the following section, and then analyse it with respect to the section 2, hope it'll clarify the doubt.

/*------------------------------------Start--------------------------------*/
#include <etc.h>

int
foo (_x)
deftype **_x;
{
    //... do something
    return 0;
}

int
main (void)
{
    //... blah
    deftype *_y;
    //... blah
    foo (&y)
    /*
     *no local copy of _y passed to function, just the reference to the pointer,
     *you don't want to create another local pointer to the variable pointed to by
     *_y, do you! :)
     */
    //... blah
    return 0;
} //EOF
/*--------------------------------Section 2----------------------------*/
#include <etc2.h>

int
foo (_x)
deftype *_x;
{
    //... do something
    return 0;
}

int
main (void)
{
    //... blah
    deftype _y; // !!! note the difference in declaration
    //... blah
    foo (&y)
    /*
     *no local copy of _y passed to function, just the reference to the variable,
     *you don't want to create another local copy of the variable _y, do you! :)
     */
    //... blah
    return 0;
} //EOF

/*----------------------------------Stop------------------------------*/

If possible, do send across the piece of code that you are trying.

cheers

vjs08
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now