gpt4 book ai didi

gcc - 为-Wimplicit-interface禁用-Werror

转载 作者:行者123 更新时间:2023-12-02 10:46:42 27 4
gpt4 key购买 nike

禁止将特定警告视为GCC错误的正确标志或标志顺序是什么?我想为-Wimplicit-interface做到这一点。

>cat test.f90 
call s
end

> gfortran -c -Werror -Wimplicit-interface -Wno-error=implicit-interface test.f90 -o test.o
test.f90:1.7:

call s
1
Warning: Procedure 's' called with an implicit interface at (1)

>ls test*
test.f90

没有生成 test.o

没有 -Werror,它就可以工作
> gfortran -c -Wimplicit-interface -Wno-error=implicit-interface test.f90 -o test.o
test.f90:1.7:

call s
1
Warning: Procedure 's' called with an implicit interface at (1)
> ls test*
test.f90 test.o

GCC版本为 gcc version 4.9.2 20141030 (Cray Inc.) (GCC)

最佳答案

这不是对该问题的明确答案。我发现它具有教育意义,而且时间太长,无法发表评论。

如您所见,如果将-Werror-Wno-error=implicit-interface结合使用,可能无法实现所需的功能。让我解释一下:与doc中的内容相反,尤其是以下句子,

The combined effect of positive and negative forms is that more specific options have priority over less specific ones, independently of their position in the command-line.



在实际实现中似乎并非如此。我最近有一个类似的问题,通过谷歌搜索,我发现 this包含以下句子:

'-w' permanently sets all warnings off no matter what specific warning is set on



它实际上建议通过使用某些非特定选项,实际的实现不允许您更改非特定选项中包括的特定选项。

关于gcc - 为-Wimplicit-interface禁用-Werror,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34770356/

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