这个错误是因为使用了Intel编译器的__attribute_malloc__属性,但是该属性不支持带参数。解决方法有两种:

  1. 修改代码 修改代码中使用了__attribute_malloc__属性的地方,去掉参数即可。例如:

将:

void *ptr __attribute__ ((malloc (10)));

改为:

void *ptr __attribute__ ((malloc));
  1. 切换编译器 如果不想修改代码,可以考虑切换到另一个编译器,如gcc编译器,它的__attribute_malloc__属性支持带参数。
使用intel编译器时出现这个报错如何处理?usrincludestdioh189 error attribute __malloc__ does not take arguments __attribute_malloc__ __attr_dealloc_fclose __wur;

原文地址: https://www.cveoy.top/t/topic/eCtN 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录