Why can the Linux kernel only compile with GCC? What GNU C extensions are really needed for some projects, and why?
This article explains the extensions used: GCC hacks in the Linux kernel . Some of them are trivial, some of them (mostly optimization tricks).
Here are a few gcc extensions for the Linux kernel:
Here are a few more: http://www.ibm.com/developerworks/linux/library/l-gcc-hacks/
Most of these gcc specifications are very architecture dependent or made possible by the implementation of gcc, and it probably doesn't make sense to use the C standard. Others are just convenient extensions for C. Since the Linux kernel is built to rely on these extensions, others compilers must provide the same extensions as gcc in order to be able to build the kernel.
This is not what Linux had to rely on these gcc features, for example. NetBSD kernel has very little to do with specific gcc materials.
The Linux kernel was written to compile GCC, so standard compliance was never a goal for kernel developers.
And if GCC offers some useful extensions that simplify or compile the kernel with less or faster conversion, it was a natural choice to use these extensions.
GCC supports Nested functions that are not part of the C99 standard. However, some analysis is needed to see how common they really are in the linux kernel.
I think this is not how it should be. There are simply a lot of useful ones, and portability of cross-compilers is not a problem for the Linux kernel to give up subtleties. Not to mention how much effort it will take to get rid of the use of extensions.