Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why must I use gnu99 instead of c99 to compile a kernel module?

I am used to using -std=c99 to enable c99 features when compiling application code.

Recently I have been following some basic kernel module examples, and added ccflags-y := -std=c99 to the makefile. However this resulted in 17K lines of errors when I tried to make. gnu99 works perfectly.

What is the difference between gnu99 and c99 that kernel code relies on?

like image 404
jsj Avatar asked May 17 '14 03:05

jsj


1 Answers

The linux kernel uses a lot of GCC extensions i.e., the C language used in the kernel is not standards compliant, it is a superset which includes GCC extension. Hence GNU99 is the compiler option which needs to be passed.

like image 162
pranith Avatar answered Nov 17 '22 05:11

pranith