This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Warning 167(-D) on const type * versus type *

I have a sourcecode like:

typedef int tQ32_16;
typedef tQ32_16 tVector3[3];

tQ32_16 Length_V3(const tVector3 * vec) {....;}

void anyfunc(void)
{

tVector3 v1 = {1,2,3}; tQ32_16 l1;

l1 = Length_V3(&v1); //==>> warning: #167-D: argument of type "tVector3 *" is incompatible with parameter of type "const tVector3 *"

....
}

Why do I get this warning ??
As far as I know this is correct C-code....

Parents
  • this is ALSO an unjust warning !!

    Hmmm. You might get some disagreement on that one.

    But anyway:

    The reason I showed you this is precisely because it does not show anything concerning your original problem; and nor do a couple of other compilers I tried. So it suggests that maybe Keil is either being over-zealous or (horror of horrors) is wrong.

    Maybe someone who obviously sees what is wrong and chooses not to say should actually back up their statement.

Reply
  • this is ALSO an unjust warning !!

    Hmmm. You might get some disagreement on that one.

    But anyway:

    The reason I showed you this is precisely because it does not show anything concerning your original problem; and nor do a couple of other compilers I tried. So it suggests that maybe Keil is either being over-zealous or (horror of horrors) is wrong.

    Maybe someone who obviously sees what is wrong and chooses not to say should actually back up their statement.

Children
No data