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....
Compiles fine here. You must have omitted significant details when posting your code.
I just created a NEW uVision project (MDK-ARM Professional v4.50)
TARGET: NXP LPC1313, everyting else just default.
and added just the following code (main.c):
typedef int tQ32_16; typedef tQ32_16 tVector3[3]; tQ32_16 Length_V3(const tVector3 * vec) { tQ32_16 result = (*vec)[0]; return result; } int main(void) { tVector3 v1 = {1,2,3}; tQ32_16 l1; l1 = Length_V3(&v1); return l1; }
And when I compile I get the following output:
Build target 'Target 1' compiling main.c... main.c(17): warning: #167-D: argument of type "tVector3 *" is incompatible with parameter of type "const tVector3 *" main.c: warning: #167-D: argument of type "tVector3 *" is incompatible with parameter of type "const tVector3 *" linking... warn167_test.axf: Error: L6218E: Undefined symbol SystemInit (referred from startup_lpc13xx.o). Target not created
View all questions in Keil forum