【发布时间】:2014-05-17 03:31:22
【问题描述】:
我习惯在编译应用程序代码时使用-std=c99来启用c99功能。
最近我一直在关注一些基本的内核模块示例,并在 makefile 中添加了ccflags-y := -std=c99。但是,当我尝试制作时,这导致了 17K 行错误。 gnu99 完美运行。
内核代码依赖的gnu99和c99有什么区别?
【问题讨论】:
-
+1。你不是第一个注意到的。见llvm.linuxfoundation.org
-
基本上内核使用GCC扩展,关闭后不编译。
-
What is the difference between gnu99 and c99 that kernel code relies on?。我认为您可以自己找到这些差异。这是来自 gcc 文档:GNU C provides several language features not found in ISO standard C. (The -pedantic option directs GCC to print a warning message if any of these features is used.)。因此,使用gnu99构建内核,但添加ccflags-y := -pedantic。然后分析警告。这是来自 gcc 的文档:gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/…
标签: c linux-kernel kernel-module c99 gnu99