gpt4 book ai didi

c - c语言内嵌嵌套的限制: Is there a hard limit on this?

转载 作者:太空宇宙 更新时间:2023-11-04 07:27:02 25 4
gpt4 key购买 nike

我正在用 C 开发一个项目。当我编译时,我得到这个错误:

warning: inlining failed in call to 'xyz()'  --param max-inline-insns-single limit reached

我的编译器将警告报告为错误,我不想绕过它。

那么,这是因为内联函数嵌套太多了吗?我可以做些什么来让它工作(除了不声明内联函数)?

谢谢!

最佳答案

作为gcc docs指出:

max-inline-insns-single:

Several parameters control the tree inliner used in gcc. This number sets the maximum number of instructions (counted in GCC's internal representation) in a single function that the tree inliner will consider for inlining. This only affects functions declared inline and methods implemented in a class declaration (C++). The default value is 500.

如果您仍然希望将警告视为错误(不是不合理的愿望),只需使用:

--param max-inline-insns-single=1000

(或一些更大的值)将其从默认值提高。

关于c - c语言内嵌嵌套的限制: Is there a hard limit on this?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17438562/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com