简体   繁体   English

如何修复 - 未使用的函数“产品”声明

[英]How to fix - Unused declaration of function 'product'

I am trying to run a program which I copied from a source code.我正在尝试运行从源代码复制的程序。 It keeps showing the warning它一直显示警告

"Unused declaration of function   'product'" for this line: int product(int x, int y);

And I don't know how to fix it.我不知道如何解决它。

There must be a prototype declaration of that function, that was not used, meaning, the function itself was not defined.必须有该函数的原型声明,未使用,这意味着未定义函数本身。

Just find the line int product(int x, int y);只需找到行int product(int x, int y); and comment it.并评论它。 By adding 2 //通过添加 2 //

//int product(int x, int y);

The warning would go.警告会消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何解决“函数的隐式声明” - How to fix “ implicit declaration of function” 如何修复函数及其声明的“冲突类型”? - How to fix “conflicting types” for a function and its declaration? 警告:function 'strcpy' [-Wimplicit-function-declaration] 的隐式声明程序工作,但我如何修复编译器错误 - warning: implicit declaration of function ‘strcpy’ [-Wimplicit-function-declaration] the program work but how i fix the compiler error 如何在编译Android内核时修复函数的隐式声明 - How to fix implicit declaration of function during compilation of android kernel 如何优雅地修复这个未使用的变量警告? - How to elegantly fix this unused variable warning? 函数声明有多重要? - How important is function declaration? 如何最好地解决这两个警告(旧式的C函数声明不是原型) - How to best fix both warnings(old style c-function declaration isn't a prototype) 我该如何解决此错误? 警告:函数“ main_menu”的隐式声明 - How do i fix this error? warning: implicit declaration of function ‘main_menu’ 如何修复'隐含的函数声明'pipe2'在C99中无效' - How to fix 'implicit declaration of function 'pipe2' is invalid in C99' 在GCC中进行优化后如何丢弃未使用的功能 - How to discard unused function after optimization in GCC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM