函数的隐式声明 - C99 [英] Implicit declaration of function - C99

查看:34
本文介绍了函数的隐式声明 - C99的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用的是 Xcode 4,在我的 .pch 文件中有这个宏:#define localize(s) NSLocalizedString((s), nil).
当我尝试在某个 .m 文件中使用此宏时,我收到以下警告:函数localize"的隐式声明在 C99 中无效.

I am currently using Xcode 4, and in my .pch file I have this macro: #define localize(s) NSLocalizedString((s), nil).
When I try to use this macro in some .m file, I receive this warning: Implicit declaration of function 'localize' is invalid in C99.

这段代码编译没有问题,但我怎样才能解决这个问题,以免收到警告?

This code compiles without a problem, but how can I fix this so I don't get a warning?

推荐答案

我在用 DLog 全局替换 NSLog 时遇到了这个问题.我愚蠢地包括了

I had this problem when I did a global replace of NSLog with DLog. I foolishly included the

#define DLog(...) NSLog(...

陈述,所以我最终得到了

statements, so I ended up with

#define DLog(...) DLog(...

导致警告和链接器错误.

which caused the warnings, and a linker error.

这篇关于函数的隐式声明 - C99的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆