Nytro Posted May 11, 2011 Report Posted May 11, 2011 GCC hacks in the Linux kernelDiscover GCC extensions for the C languageSkill Level: IntermediateM. Tim JonesConsultant EngineerEmulex Corp18 Nov 2008The Linux® kernel uses several special capabilities of the GNU Compiler Collection(GCC) suite. These capabilities range from giving you shortcuts and simplifications toproviding the compiler with hints for optimization. Discover some of these specialGCC 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 furtherexploits features in GCC, called extensions, for greater functionality andoptimization. This article explores many of these important extensions and showsyou how they're used within the Linux kernel.GCC in its current stable version (version 4.3.2) supports three versions of the Cstandard:• The original International Organization for Standardization (ISO) standardof the C language (ISO C89 or C90)• ISO C90 with amendment 1• The current ISO C99 (the default standard that GCC uses and that thisarticle assumes)Note: This article assumes that you are using the ISO C99 standard. If you specify astandard older than the ISO C99 version, some of the extensions described in thisarticle may be disabled. To specify the actual standard that GCC uses, you can usethe -std option from the command line. Use the GCC manual to verify whichextensions are supported in which versions of the standard (see Resources for alink).Applicable versionsThis article focuses on the use of GCC extensions in the 2.6.27.1Linux kernel and version 4.3.2 of GCC. Each C extension refers tothe file in the Linux kernel source where the example can be found.The available C extensions can be classified in several ways. This article puts themin two broad categories:• Functionality extensions bring new capabilities from GCC.• Optimization extensions help you generate more efficient code.Download:http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux/l-gcc-hacks/l-gcc-hacks-pdf.pdfOnline:http://www.ibm.com/developerworks/linux/library/l-gcc-hacks/index.html Quote
Nytro Posted May 12, 2011 Author Report Posted May 12, 2011 Niciuna. Sunt prezentate niste extensii ale compilatorului GCC care fac viata mai usoara. Citeste macar o parte din articol. De exemplu sa definesti "1 ... 10" care sa reprezinte orice numar de la 1 la 10. Asta nu se poate in Visual C++ de exemplu si NU face parte din standardul C! Quote