EmbDev.net

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


Author: Sevc Dominik (sevc)
Posted on:

Rate this post
0 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

Author: Mhel Marcelo (mhel)
Posted on:

Rate this post
0 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

Author: Sevc Dominik (sevc)
Posted on:

Rate this post
0 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

Author: Mhel Marcelo (mhel)
Posted on:

Rate this post
0 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 :)

Author: Sevc Dominik (sevc)
Posted on:

Rate this post
0 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

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.