1. 程式人生 > >解決cast from 'char*' to 'char**' increases required alignment of target type [-Werror=cast-align]

解決cast from 'char*' to 'char**' increases required alignment of target type [-Werror=cast-align]

 cast from 'char*' to 'char**' increases required alignment of target type [-Werror=cast-align]

如#define NEXT(t)  ((char **)(t))[nextCol]

改由memcpy替換。

  NEXT (tuple) = tuple + tupleLen;-->


  char* pCharTemp = tuple + tupleLen;
  memcpy(tuple + nextCol, &pCharTemp, sizeof(char*));
  tuple += tupleLen;