文档详情

gcc hacks in the linux kernel.pdf

发布:2016-03-09约2.1万字共6页下载文档
文本预览下载声明
GCC hacks in the Linux kernel Discover GCC extensions for the C language Level: Intermediate M. Tim Jones, Consultant Engineer, Emulex Corp. 18 Nov 2008 The Linux kernel uses several special capabilities of the GNU Compiler Collection (GCC) suite. These capabilities range from giving you shortcuts and simplifications to providing the compiler with hints for optimization. Discover some of these special GCC features and learn how to use them in the Linux kernel. GCC and Linux are a great pair. Although they are independent pieces of software, Linux is totally dependent on GCC to enable it on new architectures. Linux further exploits features in GCC, called extensions, for greater functionality and optimization. This article explores many of these important extensions and shows you how theyre used within the Linux kernel. GCC in its current stable version (version 4.3.2) supports three versions of the C standard: The original International Organization for Standardization (ISO) standard of the C language (ISO C89 or C90) ISO C90 with amendment 1 The current ISO C99 (the default standard that GCC uses and that this article assumes) Note: This article assumes that you are using the ISO C99 standard. If you specify a standard older than the ISO C99 version, some of the extensions described in this article may be disabled. To specify the actual standard that GCC uses, you can use the -std option from the command line. Use the GCC manual to verify which extensions are supported in which versions of the standard (see Resources for a link). The available C extensions can be classified in several ways. This article Applicable versions puts them in two broad categories: This article focuses on the use of GCC extensions in the Linux kernel and Functionality extensions br
显示全部
相似文档