Help to resolve some problem

#1173512
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
OP #1173513
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
#1173514
> 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 :)
OP #1173515
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

Reply

A question of your own? This thread is over 18 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.