EmbDev.net

Forum: ARM programming with GCC/GNU tools Help to resolve some problem


von Sevc D. (sevc)


Rate this post
useful
not useful
Hi all again.
I use pointer with structure and compiler show problem:
cnc1.c:76: warning: passing argument 4 of 'StartMove' discards
qualifiers from pointer target type

Program work but how can I resolve this warning???

I like if compiler donw't show any warning or error.

regards

von Mhel M. (mhel)


Rate this post
useful
not useful
I think it has something to do with const qualifier.
you can try casting the said argument...or...

you could post the code for other's to see. :)


Sevc Dominik wrote:
> Hi all again.
> I use pointer with structure and compiler show problem:
> cnc1.c:76: warning: passing argument 4 of 'StartMove' discards
> qualifiers from pointer target type
>
> Program work but how can I resolve this warning???
>
> I like if compiler donw't show any warning or error.
>
> regards

von Sevc D. (sevc)


Rate this post
useful
not useful
in file axes.h is:
typedef struct {
    float  Vactual;
    float  Vmax;
    float  Vneed;
    float  Vstart;
    float  Amax;
               }  Ax_parameter;

extern volatile Ax_parameter Ax_p_x;
extern void MoveAx(Ax_parameter *Ax_par, BYTE Ax);

in axes.c is :

volatile Ax_parameter Ax_p_x = {0,0,0,0,0};

in main.c is:
MoveAx(&Ax_p_x,0);
on this line compiler show warning .
any sugestion????

regards

von Mhel M. (mhel)


Rate this post
useful
not useful
> MoveAx(&Ax_p_x,0);
> on this line compiler show warning .

the above line doesn't match the warning you get

>warning: passing argument 4 of 'StartMove' discards

I'm positive that the warning you get is in the line
that says something "like"...

StartMove(arg1,arg2,arg3,arg4,arg...);



..just trying to help :)

von Sevc D. (sevc)


Rate this post
useful
not useful
Oh yes I use differ function not StartMove but MoveAx , but parameter is
same.
Warning show so 4th argument is not good definition, if use function
MoveAx then compiler show warning passing argument 1 of 'MoveAx'
discards


regards

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.