工具/软件:TI C/C++编译器
你(们)好
我需要禁用 VLA 分配、因为我们的堆大小不足以分配 VLA 块。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:TI C/C++编译器
你(们)好
我需要禁用 VLA 分配、因为我们的堆大小不足以分配 VLA 块。
没有方法仅禁用 VLA。
VLA 功能是 C11标准的一部分。 默认情况下、TI 编译器支持 C89标准以及其他标准作为扩展。 因此、您可以考虑使用-strict_ansi 选项、该选项禁用所有语言扩展。 如果 VLA 是您的代码使用的唯一语言扩展、则可以使用。 如果您的代码使用其他语言扩展、则可能不起作用。
如果确实使用了--strict_ansi、请了解添加--C11会导致编译器支持 C11标准、其中包括 VLA。 因此、在选项-strict_ansi --C11的组合下、支持 VLA。
谢谢、此致、
乔治