0
#include <stdio.h>

typedef float FloatArray[5];

static void doSomething(const FloatArray* i_data){
  (void)i_data;
}


int main(void){
  FloatArray fa = {1,2,4,5,6};
  doSomething(&fa);
  return 0;
}

I get the following warning and i do not understand why

passing argument 0 of 'doSomething' from incompatible pointer type

If I remove the const from the function argument then the warning disappears.

gcc is called with

-c -std=c99 -Wall -Wextra -Wfloat-conversion -Wenum-compare -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Winline -Wnested-externs -pedantic -mfpu=neon -mfloat-abi=hard

vlad_tepesch
  • 6,681
  • 1
  • 38
  • 80

0 Answers0