C99向后兼容C89吗? [英] Is C99 backward compatible with C89?

查看:139
本文介绍了C99向后兼容C89吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经习惯了老式C语言,并且最近才开始探索c99功能。我只有一个问题:如果我在程序中使用c99(带有 gcc 的c99标志并将其链接到以前的c99库),我的程序能否成功编译?

I'm used to old-style C and and have just recently started to explore c99 features. I've just one question: Will my program compile successfully if I use c99 in my program, the c99 flag with gcc and link it with prior c99 libraries?

那么,我应该坚持使用旧的C89还是进化?

So, should I stick to old C89 or evolve?

推荐答案

我相信它们在这方面是兼容的。只要您要编译的东西不会踩到任何新东西即可。例如,如果旧代码包含 enum bool {false,true}; ,那么您就有麻烦了。作为一个类似的恐龙,我正在慢慢拥抱C99的美好新世界。毕竟,它仅潜伏在那里已有10年了;)

I believe that they are compatible in that respect. That is as long as the stuff that you are compiling against doesn't step on any of the new goodies. For instance, if the old code contains enum bool { false, true }; then you are in trouble. As a similar dinosaur, I am slowly embracing the wonderful new world of C99. After all, it has only been out there lurking for about 10 years now ;)

这篇关于C99向后兼容C89吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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