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

来源:互联网 发布:家庭预算软件 编辑:程序博客网 时间:2024/05/24 02:41

 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;