Hide thumbs Also See for ENTERPRISE LINUX 4:
Table of Contents

Advertisement

Red Hat Enterprise Linux 4

Advertisement

Table of Contents
loading

Summary of Contents for Red Hat ENTERPRISE LINUX 4

  • Page 1 Red Hat Enterprise Linux 4...
  • Page 2: Red Hat Enterprise Linux

    All other trademarks referenced herein are the property of their respective owners. The GPG fingerprint of the security@redhat.com key is: CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E...
  • Page 3: Table Of Contents

    Table of Contents 1. Introduction............................. 1 2. Programming Languages Supported by GCC ................3 3. Language Standards Supported by GCC ..................5 4. GCC Command Options ........................ 7 4.1. Option Summary........................ 7 4.2. Options Controlling the Kind of Output ................16 4.3.
  • Page 4 6. Extensions to the C Language Family..................131 6.1. Statements and Declarations in Expressions..............131 6.2. Locally Declared Labels ....................132 6.3. Labels as Values......................133 6.4. Nested Functions......................134 6.5. Constructing Function Calls ..................136 6.6. Referring to a Type with ..................
  • Page 5 6.45. Other built-in functions provided by GCC ..............209 6.46. Built-in Functions Specific to Particular Target Machines .......... 215 6.46.1. X86 Built-in Functions ................. 215 6.46.2. PowerPC AltiVec Built-in Functions ............219 6.47. Pragmas Accepted by GCC ..................249 6.47.1. RS/6000 and PowerPC Pragmas ..............249 6.47.2.
  • Page 6 11.12. Warning Messages and Error Messages..............298 12. Funding Free Software ......................299 Option Index............................ 301 Keyword Index ..........................315...
  • Page 7 Red Hat Enterprise Linux 4...
  • Page 9: Introduction

    Chapter 1. Introduction This manual documents how to use the GNU compilers, as well as their features and incompatibilities, and how to report bugs. It corresponds to GCC version 3.4.4. The internals of the GNU compilers, including how to port them to new targets and some information about how to write front ends for new languages, are documented in a separate manual.
  • Page 10 Chapter 1. Introduction...
  • Page 11: Programming Languages Supported By Gcc

    Chapter 2. Programming Languages Supported by GCC GCC stands for "GNU Compiler Collection". GCC is an integrated distribution of compilers for sev- eral major programming languages. These languages currently include C, C++, Objective-C, Java, Fortran, and Ada. The abbreviation GCC has multiple meanings in common use. The current official meaning is "GNU Compiler Collection", which refers generically to the complete suite of tools.
  • Page 12 Chapter 2. Programming Languages Supported by GCC...
  • Page 13: Language Standards Supported By Gcc

    Chapter 3. Language Standards Supported by GCC For each language compiled by GCC for which there is a standard, GCC attempts to follow one or more versions of that standard, possibly with some exceptions, and possibly with some extensions. GCC supports three versions of the C standard, although support for the most recent version is not yet complete.
  • Page 14 Chapter 3. Language Standards Supported by GCC GCC aims towards being usable as a conforming freestanding implementation, or as the compiler for a conforming hosted implementation. By default, it will act as the compiler for a hosted implemen- tation, defining and presuming that when the names of ISO C functions are __STDC_HOSTED__ used, they have the semantics defined in the standard.
  • Page 15: Gcc Command Options

    Chapter 4. GCC Command Options When you invoke GCC, it normally does preprocessing, compilation, assembly and linking. The "overall options" allow you to stop this process at an intermediate stage. For example, the tion says not to run the linker. Then the output consists of object files output by the assembler. Other options are passed on to one stage of processing.
  • Page 16 Chapter 4. GCC Command Options -ffor-scope -fno-for-scope -fno-gnu-keywords -fno-implicit-templates -fno-implicit-inline-templates -fno-implement-inlines -fms-extensions -fno-nonansi-builtins -fno-operator-names -fno-optional-diags -fpermissive -frepo -fno-rtti -fstats -ftemplate-depth- -fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ -fno-default-inline -fvisibility-inlines-hidden -Wabi -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Weffc++ -Wno-deprecated -Wno-non-template-friend -Wold-style-cast -Woverloaded-virtual -Wno-pmf-conversions -Wsign-promo -Wsynth Objective-C Language Options Section 4.6 Options Controlling Objective-C Dialect.
  • Page 17 Chapter 4. GCC Command Options C-only Warning Options -Wbad-function-cast -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wstrict-prototypes -Wtraditional -Wdeclaration-after-statement Debugging Options Section 4.9 Options for Debugging Your Program or GCC. -dumpspecs -dumpmachine -dumpversion letters -fdump-unnumbered -fdump-translation-unit[- -fdump-class-hierarchy[- -fdump-tree-original[- -fdump-tree-optimized[- -fdump-tree-inlined[- -feliminate-dwarf2-dups -feliminate-unused-debug-types -feliminate-unused-debug-symbols -fmem-report -fprofile-arcs -frandom-seed= -fsched-verbose= string...
  • Page 18 Chapter 4. GCC Command Options -funroll-all-loops -funroll-loops -fpeel-loops -funswitch-loops -fold-unroll-loops -fold-unroll-all-loops --param name value Preprocessor Options Section 4.11 Options Controlling the Preprocessor. question answer question answer macro defn -idirafter -include -imacros file file -iprefix -iwithprefix file -iwithprefixbefore -isystem -nostdinc -fworking-directory -remap -trigraphs -undef...
  • Page 19 Chapter 4. GCC Command Options SPARC Options -mcpu= cpu-type -mtune= cpu-type -mcmodel= code-model -m32 -m64 -mapp-regs -mno-app-regs -mfaster-structs -mno-faster-structs -mflat -mno-flat -mfpu -mno-fpu -mhard-float -msoft-float -mhard-quad-float -msoft-quad-float -mimpure-text -mno-impure-text -mlittle-endian -mstack-bias -mno-stack-bias -munaligned-doubles -mno-unaligned-doubles -mv8plus -mno-v8plus -mvis -mno-vis -mcypress -mf930 -mf934 -msparclite -msupersparc...
  • Page 20 Chapter 4. GCC Command Options -mpowerpc -mpowerpc64 -mno-powerpc -maltivec -mno-altivec -mpowerpc-gpopt -mno-powerpc-gpopt -mpowerpc-gfxopt -mno-powerpc-gfxopt -mnew-mnemonics -mold-mnemonics -mfull-toc -mminimal-toc -mno-fp-in-toc -mno-sum-in-toc -m64 -m32 -mxl-call -mno-xl-call -mpe -malign-power -malign-natural -msoft-float -mhard-float -mmultiple -mno-multiple -mstring -mno-string -mupdate -mno-update -mfused-madd -mno-fused-madd -mbit-align -mno-bit-align -mstrict-align -mno-strict-align -mrelocatable -mno-relocatable...
  • Page 21 Chapter 4. GCC Command Options -mcheck-zero-division -mno-check-zero-division -mmemcpy -mno-memcpy -mlong-calls -mno-long-calls -mmad -mno-mad -mfused-madd -mno-fused-madd -nocpp -mfix-sb1 -mno-fix-sb1 -mflush-func= func -mno-flush-func -mbranch-likely -mno-branch-likely i386 and x86-64 Options -mtune= -march= cpu-type cpu-type -mfpmath= unit -masm= -mno-fancy-math-387 dialect -mno-fp-ret-in-387 -msoft-float -msvr3-shlib -mno-wide-multiply -mrtd -malign-double -mpreferred-stack-boundary=...
  • Page 22 Chapter 4. GCC Command Options -m2e -m3e -m4-nofpu -m4-single-only -m4-single -m5-64media -m5-64media-nofpu -m5-32media -m5-32media-nofpu -m5-compact -m5-compact-nofpu -mdalign -mrelax -mbigtable -mfmovd -mhitachi -mnomacsave -mieee -misize -mpadstruct -mspace -mprefergot -musermode System V Options -YP, -Ym, paths ARC Options -mmangle-cpu -mcpu= -mtext= text-section -mdata= -mrodata= data-section...
  • Page 23 Chapter 4. GCC Command Options D30V Options -mextmem -mextmemory -monchip -mno-asm-optimize -masm-optimize -mbranch-cost= -mcond-exec= S/390 and zSeries Options -mtune= -march= cpu-type cpu-type -mhard-float -msoft-float -mbackchain -mno-backchain -mkernel-backchain -msmall-exec -mno-small-exec -mmvcle -mno-mvcle -m64 -m31 -mdebug -mno-debug -mesa -mzarch -mfused-madd -mno-fused-madd -mwarn-framesize -mwarn-dynamicstack -mstack-size -mstack-guard CRIS Options...
  • Page 24: Options Controlling The Kind Of Output

    Chapter 4. GCC Command Options -fshort-double -fshort-wchar -fverbose-asm -fpack-struct -fstack-check -fstack-limit-register= -fstack-limit-symbol= -fargument-alias -fargument-noalias -fargument-noalias-global -fleading-underscore -ftls-model= model -ftrapv -fwrapv -fbounds-check -fvisibility 4.2. Options Controlling the Kind of Output Compilation can involve up to four stages: preprocessing, compilation proper, assembly and linking, always in that order.
  • Page 25 Chapter 4. GCC Command Options file .for file .FOR file Fortran source code which should not be preprocessed. file .fpp file .FPP file Fortran source code which must be preprocessed (with the traditional preprocessor). file Fortran source code which must be preprocessed with a RATFOR preprocessor (not included with GCC).
  • Page 26 Chapter 4. GCC Command Options -pass-exit-codes Normally the program will exit with the code of 1 if any phase of the compiler returns a non-success return code. If you specify , the program will instead -pass-exit-codes return with numerically highest error produced by any phase that returned an error indication. If you only want some of the stages of compilation, you can use (or filename suffixes) to tell where to start, and one of the options...
  • Page 27: Compiling C++ Programs

    Chapter 4. GCC Command Options -pipe Use pipes rather than temporary files for communication between the various stages of compila- tion. This fails to work on some systems where the assembler is unable to read from a pipe; but the GNU assembler has no trouble. -help Print (on the standard output) a description of the command line options understood by .
  • Page 28 Chapter 4. GCC Command Options The alternate keywords continue __asm__ __extension__ __inline__ __typeof__ to work despite . You would not want to use them in an ISO C program, of course, but -ansi it is useful to put them in header files that might be included in compilations done with -ansi Alternate predefined macros such as are also available, with or without...
  • Page 29 Chapter 4. GCC Command Options options specifying some version of ISO C have the same effects as , except that -std -ansi features that were not in ISO C90 but are in the specified version (for example, comments and keyword in ISO C99) are not disabled. inline Chapter 3 Language Standards Supported by GCC, for details of these standard versions.
  • Page 30 Chapter 4. GCC Command Options -ffreestanding Assert that compilation takes place in a freestanding environment. This implies -fno-builtin A freestanding environment is one in which the standard library may not exist, and program startup may not necessarily be at . The most obvious example is an OS kernel. This is main equivalent to -fno-hosted...
  • Page 31: Options Controlling C++ Dialect

    Chapter 4. GCC Command Options -fsigned-bitfields -funsigned-bitfields -fno-signed-bitfields -fno-unsigned-bitfields These options control whether a bit-field is signed or unsigned, when the declaration does not use either . By default, such a bit-field is signed, because this is consistent: signed unsigned the basic integer types such as are signed types.
  • Page 32 Chapter 4. GCC Command Options compile with this flag and your program mysteriously crashes after has completed, you main() may have an object that is being destroyed twice because two definitions were merged. This option is no longer useful on most targets, now that support has been added for putting variables into BSS without making them common.
  • Page 33 Chapter 4. GCC Command Options -fms-extensions Disable pedantic warnings about constructs used in MFC, such as implicit int and getting a pointer to member function via non-standard syntax. -fno-nonansi-builtins Disable built-in declarations of functions that are not mandated by ANSI/ISO C. These include , and other related functions.
  • Page 34 Chapter 4. GCC Command Options PLT indirection when used within the DSO. Enabling this option can have a dramatic effect on load and link times of a DSO as it massively reduces the size of the dynamic export table when the library makes heavy use of templates.
  • Page 35 Chapter 4. GCC Command Options union U { int i : 4096; }; Assuming that an does not have 4096 bits, G++ will make the union too small by the number of bits in an Empty classes can be placed at incorrect offsets. For example: •...
  • Page 36 Chapter 4. GCC Command Options Item 14: Make destructors virtual in base classes. • Item 15: Have return a reference to • operator= *this Item 23: Don’t try to return a reference when you must return an object. • Also warn about violations of the following style guidelines from Scott Meyers’ [More Effective C++] book: Item 6: Distinguish between prefix and postfix forms of increment and decrement operators.
  • Page 37: Options Controlling Objective-C Dialect

    Chapter 4. GCC Command Options -Wsign-promo (C++ only) Warn when overload resolution chooses a promotion from unsigned or enumerated type to a signed type, over a conversion to an unsigned type of the same size. Previous versions of G++ would try to preserve unsignedness, but the standard mandates the current behavior. -Wsynth (C++ only) Warn when G++’s synthesis behavior does not match that of cfront.
  • Page 38 Chapter 4. GCC Command Options -fno-nil-receivers Assume that all Objective-C message dispatches (e.g., ) in this [receiver message:arg] translation unit ensure that the receiver is not . This allows for more efficient entry points in the runtime to be used. Currently, this option is only available in conjunction with the NeXT runtime on Mac OS X 10.3 and later.
  • Page 39 Chapter 4. GCC Command Options switch also enables the use of synchronization blocks for thread-safe -fobjc-exceptions execution: @synchronized (ObjCClass *guard) { Upon entering the block, a thread of execution shall first check whether a lock @synchronized has been placed on the corresponding object by another thread.
  • Page 40: Options To Control Diagnostic Messages Formatting

    Chapter 4. GCC Command Options expression, either explicitly in an declaration, @selector(...) @interface @protocol or implicitly in an section. This option always performs its checks as soon @implementation as a expression is found, while only performs its checks in the @selector(...) -Wselector final stage of compilation.
  • Page 41 Chapter 4. GCC Command Options -pedantic Issue all the warnings demanded by strict ISO C and ISO C++; reject all programs that use forbidden extensions, and some other programs that do not follow ISO C and ISO C++. For ISO C, follows the version of the ISO C standard specified by any option used.
  • Page 42 Chapter 4. GCC Command Options and some BSD and GNU extensions. Other library implementations may not support all these features; GCC does not support warning about features that go beyond a particular library’s limitations. However, if is used with , warnings will be given about format -pedantic -Wformat features not in the selected standard version (but not for...
  • Page 43 Chapter 4. GCC Command Options -Winit-self (C, C++, and Objective-C only) Warn about uninitialized variables which are initialized with themselves. Note this option can only be used with the option, which in turn only works with and above. -Wuninitialized For example, GCC will warn about being uninitialized in the following snippet only when has been specified: -Winit-self...
  • Page 44 Chapter 4. GCC Command Options if (a) if (b) foo (); else bar (); -Wsequence-point Warn about code that may have undefined semantics because of violations of sequence point rules in the C standard. The C standard defines the order in which expressions in a C program are evaluated in terms of sequence points, which represent a partial ordering between the execution of parts of the program: those executed before the sequence point, and those executed after it.
  • Page 45 Chapter 4. GCC Command Options -Wswitch-default Warn whenever a statement does not have a case. switch default -Wswitch-enum Warn whenever a statement has an index of enumerated type and lacks a for one switch case or more of the named codes of that enumeration. labels outside the enumeration range also case provoke warnings when this option is used.
  • Page 46 Chapter 4. GCC Command Options These warnings occur only for variables that are candidates for register allocation. Therefore, they do not occur for a variable that is declared , or whose address is taken, or whose volatile size is other than 1, 2, 4 or 8 bytes. Also, they do not occur for structures, unions or arrays, even when they are in registers.
  • Page 47 Chapter 4. GCC Command Options -Wall All of the above options combined. This enables all the warnings about constructions that some users consider questionable, and that are easy to avoid (or modify to prevent the warning), even in conjunction with macros. This also enables some language-specific warnings described in Section 4.5 Options Controlling C++ Dialect and Section 4.6 Options Controlling Objective-C Dialect.
  • Page 48 Chapter 4. GCC Command Options Any of several floating-point events that often indicate errors, such as overflow, underflow, • loss of precision, etc. (C++ only) An enumerator and a non-enumerator both appear in a conditional expression. • (C++ only) A non-static reference or non-static member appears in a class without •...
  • Page 49 Chapter 4. GCC Command Options the system headers of most modern systems, e.g. the macros in _MIN _MAX limits.h Use of these macros in user code might normally lead to spurious warnings, however GCC’s integrated preprocessor has enough context to avoid warning in these cases. A function declared external in one block and then used after the end of the block.
  • Page 50 Chapter 4. GCC Command Options -Wpointer-arith Warn about anything that depends on the "size of" a function type or of . GNU C assigns void these types a size of 1, for convenience in calculations with pointers and pointers to void * functions.
  • Page 51 Chapter 4. GCC Command Options -Wmissing-prototypes (C only) Warn if a global function is defined without a previous prototype declaration. This warning is issued even if the definition itself provides a prototype. The aim is to detect global functions that fail to be declared in header files.
  • Page 52 Chapter 4. GCC Command Options -Wredundant-decls Warn if anything is declared more than once in the same scope, even in cases where multiple declaration is valid and changes nothing. -Wnested-externs (C only) Warn if an declaration is encountered within a function. extern -Wunreachable-code Warn if the compiler detects that code will never be executed.
  • Page 53: Options For Debugging Your Program Or Gcc

    Chapter 4. GCC Command Options -Wdisabled-optimization Warn if a requested optimization pass is disabled. This warning does not generally indicate that there is anything wrong with your code; it merely indicates that GCC’s optimizers were unable to handle the code effectively. Often, the problem is that your code is too big or too complex; GCC will refuse to optimize programs when the optimization itself is likely to take inordinate amounts of time.
  • Page 54 Chapter 4. GCC Command Options -gstabs+ Produce debugging information in stabs format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB). The use of these extensions is likely to make other debuggers crash or refuse to read the program. -gcoff Produce debugging information in COFF format (if that is supported).
  • Page 55 Chapter 4. GCC Command Options Generate extra code to write profile information suitable for the analysis program . You prof must use this option when compiling the source files you want data about, and you must also use it when linking. Generate extra code to write profile information suitable for the analysis program .
  • Page 56 Chapter 4. GCC Command Options -ftest-coverage Produce a notes file that the code-coverage utility (Chapter 10 --a Test Coverage gcov gcov Program) can use to show program coverage. Each source file’s note file is called .gcno auxname Refer to the option above for a description of and instructions on -fprofile-arcs...
  • Page 57 Chapter 4. GCC Command Options Dump after GCSE, to . Also dump after jump bypassing and control flow .08.gcse file optimizations, to .10.bypass file Dump after finalization of EH handling code, to .03.eh file Dump after sibling call optimizations, to .02.sibling file Dump after the first jump optimization, to...
  • Page 58 Chapter 4. GCC Command Options Dump after running tracer, to .15.tracer file Dump after null pointer elimination pass to .05.null file Dump callgraph and unit-at-a-time optimization .00.unit file Dump after the value profile transformations, to .13.vpt file Dump after the second flow pass, to .27.flow2 file Dump after the peephole pass, to...
  • Page 59 Chapter 4. GCC Command Options -fdump-unnumbered When doing debugging dumps (see option above), suppress instruction numbers and line number note output. This makes it more feasible to use diff on debugging dumps for compiler invocations with different options, in particular with and without -fdump-translation-unit (C and C++ only) -fdump-translation-unit- (C and C++ only)
  • Page 60 Chapter 4. GCC Command Options -frandom-seed= string This option provides a seed that GCC uses when it would otherwise use random numbers. It is used to generate certain symbol names that have to be different in every compiled file. It is also used to place unique stamps in coverage data files and the object files that produce them.
  • Page 61: Options That Control Optimization

    Chapter 4. GCC Command Options -print-libgcc-file-name Same as -print-file-name=libgcc.a This is useful when you use but you do want to link with -nostdlib -nodefaultlibs . You can do libgcc.a gcc -nostdlib ... ‘gcc -print-libgcc-file-name‘ files -print-search-dirs Print the name of the configured installation directory and a list of program and library directories will search--and don’t do anything else.
  • Page 62 Chapter 4. GCC Command Options Optimize. Optimizing compilation takes somewhat more time, and a lot more memory for a large function. With , the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time. turns on the following optimization flags: -fdefer-pop -fmerge-constants...
  • Page 63 Chapter 4. GCC Command Options Optimize for size. enables all optimizations that do not typically increase code size. It also performs further optimizations designed to reduce code size. disables the following optimization flags: -falign-functions -falign-jumps -falign-loops -falign-labels -freorder-blocks -fprefetch-loop-arrays If you use multiple options, with or without level numbers, the last such option is the one that is effective.
  • Page 64 Chapter 4. GCC Command Options -foptimize-sibling-calls Optimize sibling and tail recursive calls. Enabled at levels -fno-inline Don’t pay attention to the keyword. Normally this option is used to keep the compiler inline from expanding any functions inline. Note that if you are not optimizing, no functions can be expanded inline.
  • Page 65 Chapter 4. GCC Command Options -fkeep-static-consts Emit variables declared when optimization isn’t turned on, even if the variables static const aren’t referenced. GCC enables this option by default. If you want to force the compiler to check if the variable was referenced, regardless of whether or not optimization is turned on, use the option.
  • Page 66 Chapter 4. GCC Command Options -fstrength-reduce Perform the optimizations of loop strength reduction and elimination of iteration variables. Enabled at levels -fthread-jumps Perform optimizations where we check to see if a jump branches to a location where another comparison subsumed by the first is found. If so, the first branch is redirected to either the des- tination of the second branch or a point immediately following it, depending on whether the condition is known to be true or false.
  • Page 67 Chapter 4. GCC Command Options , loops containing a load/store sequence can be changed to a load before the loop and -fgcse-lm a store after the loop. Enabled by default when gcse is enabled. -fgcse-las When is enabled, the global common subexpression elimination pass eliminates -fgcse-las redundant loads that come after stores to the same memory location (both partial and full redun- dancies).
  • Page 68 Chapter 4. GCC Command Options -foptimize-register-move -fregmove Attempt to reassign register numbers in move instructions and as operands of other simple instructions in order to maximize the amount of register tying. This is especially helpful on machines with two-operand instructions. Note are the same optimization.
  • Page 69 Chapter 4. GCC Command Options -fsched2-use-superblocks When scheduling after register allocation, do use superblock scheduling algorithm. Superblock scheduling allows motion across basic block boundaries resulting on faster schedules. This option is experimental, as not all machine descriptions used by GCC model the CPU closely enough to avoid unreliable results from the algorithm.
  • Page 70 Chapter 4. GCC Command Options -fno-guess-branch-probability Do not guess branch probabilities using a randomized model. Sometimes GCC will opt to use a randomized model to guess branch probabilities, when none are available from either profiling feedback ( ) or . This -fprofile-arcs __builtin_expect means that different runs of the compiler on the same program may produce different object...
  • Page 71 Chapter 4. GCC Command Options Every language that wishes to perform language-specific alias analysis should define a function that computes, given an node, an alias set for the node. Nodes in different alias sets are not tree allowed to alias. For an example, see the C front-end function c_get_alias_set Enabled at levels -falign-functions...
  • Page 72 Chapter 4. GCC Command Options is not specified or is zero, use a machine-dependent default. Enabled at levels -frename-registers Attempt to avoid false dependencies in scheduled code by making use of registers left over after register allocation. This optimization will most benefit processors with lots of registers. It can, however, make debugging impossible, since variables will no longer stay in a "home register".
  • Page 73 Chapter 4. GCC Command Options This option should never be turned on by any option since it can result in incorrect output for programs which depend on an exact implementation of IEEE or ISO rules/specifications for math functions. -fno-math-errno Do not set ERRNO after calling math functions that are executed with a single instruction, e.g., sqrt.
  • Page 74 Chapter 4. GCC Command Options setting using C99’s pragma. This command line option will be used to specify FENV_ACCESS the default state for FENV_ACCESS -fsignaling-nans Compile code assuming that IEEE signaling NaNs may generate user-visible traps during floating-point operations. Setting this option disables optimizations that may change the number of exceptions visible with signaling NaNs.
  • Page 75 Chapter 4. GCC Command Options -ftracer Perform tail duplication to enlarge superblock size. This transformation simplifies the control flow of the function allowing other optimizations to do better job. -funit-at-a-time Parse the whole compilation unit before starting to produce code. This allows some extra opti- mizations to take place but consumes more memory.
  • Page 76 Chapter 4. GCC Command Options Disabled at level -ffunction-sections -fdata-sections Place each function or data item into its own section in the output file if the target supports arbitrary sections. The name of the function or the name of the data item determines the section’s name in the output file.
  • Page 77 Chapter 4. GCC Command Options max-gcse-memory The approximate maximum amount of memory that will be allocated in order to perform the global common subexpression elimination optimization. If more memory than specified is required, the optimization will not be done. max-gcse-passes The maximum number of passes of GCSE to run.
  • Page 78 Chapter 4. GCC Command Options max-unroll-times The maximum number of unrollings of a single loop. max-peeled-insns The maximum number of instructions that a loop should have if that loop is peeled, and if the loop is peeled, it determines how many times the loop code is peeled. max-peel-times The maximum number of peelings of a single loop.
  • Page 79 Chapter 4. GCC Command Options Similarly to two values are present, one for compilation for tracer-dynamic-coverage profile feedback and one for compilation without. The value for compilation with profile feedback needs to be more conservative (higher) in order to make tracer effective. max-cse-path-length Maximum number of basic blocks on path that cse considers.
  • Page 80: Options Controlling The Preprocessor

    Chapter 4. GCC Command Options reorder-blocks-duplicate-feedback Used by basic block reordering pass to decide whether to use unconditional branch or du- plicate the code on its destination. Code is duplicated when its estimated size is smaller than this value multiplied by the estimated size of unconditional jump in the hot spots of the program.
  • Page 81 Chapter 4. GCC Command Options name Cancel any previous definition of , either built in or provided with a option. name -undef Do not predefine any system-specific or GCC-specific macros. The standard predefined macros remain defined. Add the directory to the list of directories to be searched for header files. Directories named are searched before the standard system include directories.
  • Page 82 Chapter 4. GCC Command Options -Wunused-macros Warn about macros defined in the main file that are unused. A macro is used if it is expanded or tested for existence at least once. The preprocessor will also warn if the macro has not been used at the time it is redefined or undefined.
  • Page 83 Chapter 4. GCC Command Options This option does not suppress the preprocessor’s debug output, such as . To avoid mixing such debug output with the dependency rules you should explicitly specify the dependency output file with , or use an environment variable like (Section 4.19 Environ- DEPENDENCIES_OUTPUT ment Variables Affecting GCC).
  • Page 84 Chapter 4. GCC Command Options The default target is automatically quoted, as if it were given with is equivalent to , except that is not implied. The driver determines -M -MF file file based on whether an option is given. If it is, the driver uses its argument but with a suffix of , otherwise it take the basename of the input file and applies a suffix.
  • Page 85 Chapter 4. GCC Command Options iso9899:1999 iso9899:199x The revised ISO C standard, published in December 1999. Before publication, this was known as C9X. gnu89 The 1990 C standard plus GNU extensions. This is the default. gnu99 gnu9x The 1999 C standard plus GNU extensions. c++98 The 1998 ISO C++ standard plus amendments.
  • Page 86 Chapter 4. GCC Command Options -idirafter Search for header files, but do it after all directories specified with and the standard system directories have been exhausted. is treated as a system include directory. -iprefix prefix Specify as the prefix for subsequent options.
  • Page 87 Chapter 4. GCC Command Options -fworking-directory Enable generation of linemarkers in the preprocessor output that will let the compiler know the current working directory at the time of preprocessing. When this option is enabled, the pre- processor will emit, after the initial linemarker, a second linemarker with the current working directory followed by two slashes.
  • Page 88 Chapter 4. GCC Command Options Inhibit generation of linemarkers in the output from the preprocessor. This might be useful when running the preprocessor on something that is not C code, and will be sent to a program which might be confused by the linemarkers. Do not discard comments.
  • Page 89: Passing Options To The Assembler

    Chapter 4. GCC Command Options even if they are found to be invalid; an invalid precompiled header file is printed with ...x a valid one with ...! -version -version Print out GNU CPP’s version number. With one dash, proceed to preprocess as normal. With two dashes, exit immediately.
  • Page 90 Chapter 4. GCC Command Options The directories searched include several standard system directories plus any that you specify with Normally the files found this way are library files--archive files whose members are object files. The linker handles an archive file by scanning through it for members which define symbols that have so far been referenced but not defined.
  • Page 91: Options For Directory Search

    Chapter 4. GCC Command Options options that were used to generate code ( , or model suboptions) when you specify -fpic -fPIC this option. -shared-libgcc -static-libgcc On systems that provide as a shared library, these options force the use of either the libgcc shared or static version respectively.
  • Page 92 Chapter 4. GCC Command Options 4.14. Options for Directory Search These options specify directories to search for header files, for libraries and for parts of the compiler: Add the directory to the head of the list of directories to be searched for header files. This can be used to override a system header file, substituting your own version, since these directories are searched before the system header file directories.
  • Page 93: Specifying Subprocesses And The Switches To Pass To Them

    Chapter 4. GCC Command Options The run-time support file can also be searched for using the prefix, if needed. If it libgcc.a is not found there, the two standard prefixes above are tried, and that is all. The file is left out of the link if it is not found by those means.
  • Page 94 Chapter 4. GCC Command Options suffix Creates a new pair. All lines after this directive and up to the next directive or ] spec suffix blank line are considered to make up the spec string for the indicated suffix. When the compiler encounters an input file with the named suffix, it will processes the spec string in order to work out how to compile that file.
  • Page 95 Chapter 4. GCC Command Options This example renames the spec called and then overrides the previous definition of old_lib with a new one. The new definition adds in some extra command-line options before including the text of the old definition. Spec strings are a list of command-line options to be passed to their corresponding program.
  • Page 96 Chapter 4. GCC Command Options suffix Substitutes the name of the , if any, and if it is writable, and if save-temps HOST_BIT_BUCKET is off; otherwise, substitute the name of a temporary file, just like . This temporary file is not meant for communication between processes, but rather as a junk disposal mechanism.
  • Page 97 Chapter 4. GCC Command Options Print as an error message. is terminated by a newline. Use this when inconsistent options are detected. name Substitute the contents of spec string at this point. name name Like but put around arguments. %(...) option Accumulate an option for Output the accumulated linker options specified by...
  • Page 98 Chapter 4. GCC Command Options Process the spec. This is a spec for deciding which object files should be the first startfile ones passed to the linker. Typically this might be a file named crt0.o Process the spec. This is a spec string that specifies the last object files that will be endfile passed to the linker.
  • Page 99 Chapter 4. GCC Command Options *startfile: crt0%O%s %:if-exists(crti%O%s) \ %:if-exists-else(crtbeginT%O%s crtbegin%O%s) Substitutes the switch, if that switch was given to GCC. If that switch was not specified, this substitutes nothing. Note that the leading dash is omitted when specifying this option, and it is automatically inserted if the substitution is performed.
  • Page 100: Specifying Target Machine And Compiler Version

    Chapter 4. GCC Command Options fred.c -foo -baz jim.d -bar -boggle -d fred.c -foo -baz -boggle -d jim.d -bar -baz -boggle %{S:X; T:Y; :D} was given to GCC, substitutes ; else if was given to GCC, substitutes ; else substitutes There can be as many clauses as you need.
  • Page 101: Ibm Rs/6000 And Powerpc Options

    Chapter 4. GCC Command Options In addition, each of these target machine types can have its own special options, starting with to choose among various hardware models or configurations--for example, 68010 vs 68020, float- ing coprocessor or none. A single installed version of the compiler can compile for any model or configuration, according to the options specified.
  • Page 102 Chapter 4. GCC Command Options not use the MQ register. Specifying both permits GCC to use any -mpower -mpowerpc instruction from either architecture and to allow use of the MQ register; specify this for the Motorola MPC601. -mnew-mnemonics -mold-mnemonics Select which mnemonics to use in the generated assembler code. With -mnew-mnemonics GCC uses the assembler mnemonics defined for the PowerPC architecture.
  • Page 103 Chapter 4. GCC Command Options -maltivec -mno-altivec These switches enable or disable the use of built-in functions that allow access to the AltiVec instruction set. You may also need to set to adjust the current ABI with AltiVec -mabi=altivec ABI enhancements. -mabi=spe Extend the current ABI with SPE ABI extensions.
  • Page 104 Chapter 4. GCC Command Options , while disables the 64-bit ABI and implies . GCC -mpowerpc -maix32 -mno-powerpc64 defaults to -maix32 -mxl-call -mno-xl-call On AIX, pass floating-point arguments to prototyped functions beyond the register save area (RSA) on the stack in addition to argument FPRs. The AIX calling convention was extended but not initially documented to handle an obscure K&R C case of calling a function that takes the address of its arguments with fewer arguments than declared.
  • Page 105 Chapter 4. GCC Command Options -mupdate -mno-update Generate code that uses (does not use) the load or store instructions that update the base register to the address of the calculated memory location. These instructions are generated by default. If you use , there is a small window between the time that the stack pointer is -mno-update updated and the address of the previous frame is stored, which means code that walks the stack...
  • Page 106 Chapter 4. GCC Command Options -mbig -mbig-endian On System V.4 and embedded PowerPC systems compile code for the processor in big endian mode. The option is the same as -mbig-endian -mbig -mdynamic-no-pic On Darwin systems, compile code so that it is not relocatable, but that its external references are relocatable.
  • Page 107 Chapter 4. GCC Command Options -mabi=altivec Extend the current ABI with AltiVec ABI extensions. This does not change the default ABI, instead it adds the AltiVec ABI extensions to the current ABI. -mabi=no-altivec Disable AltiVec ABI extensions for the current ABI. -mprototype -mno-prototype On System V.4 and embedded PowerPC systems assume that all calls to variable argument func-...
  • Page 108 Chapter 4. GCC Command Options option will only use to point to a single small data area. The option is on by default -meabi if you configured GCC using one of the options. powerpc*-*-eabi* -msdata=eabi On System V.4 and embedded PowerPC systems, put small initialized global and static const data in the...
  • Page 109: Darwin Options

    Chapter 4. GCC Command Options On Mach-O (Darwin) systems, this option directs the compiler emit to the glue for every direct call, and the Darwin linker decides whether to use or discard it. In the future, we may cause GCC to ignore all longcall specifications when the linker is known to generate glue.
  • Page 110 Chapter 4. GCC Command Options -client_name -compatibility_version -current_version -dependency-file -dylib_file -dylinker_install_name -dynamic -dynamiclib -exported_symbols_list -filelist -flat_namespace -force_cpusubtype_ALL -force_flat_namespace -headerpad_max_install_names -image_base -init -install_name -keep_private_externs -multi_module -multiply_defined -multiply_defined_unused -noall_load -nofixprebinding -nomultidefs -noprebind -noseglinkedit -pagezero_size -prebind -prebind_all_twolevel_modules -private_bundle -read_only_relocs -sectalign -sectobjectsymbols -whyload -seg1addr -sectcreate -sectobjectsymbols -sectorder...
  • Page 111: Intel 386 And Amd X86-64 Options

    Chapter 4. GCC Command Options 4.17.3. Intel 386 and AMD x86-64 Options These options are defined for the i386 and x86-64 family of computers: -mtune= cpu-type Tune to everything applicable about the generated code, except for the ABI and the cpu-type set of available instructions.
  • Page 112 Chapter 4. GCC Command Options athlon, athlon-tbird AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and SSE prefetch instructions support. athlon-4, athlon-xp, athlon-mp Improved AMD Athlon CPU with MMX, 3dNOW!, enhanced 3dNOW! and full SSE in- struction set support. k8, opteron, athlon64, athlon-fx AMD K8 core based CPUs with x86-64 instruction set support.
  • Page 113 Chapter 4. GCC Command Options Use the standard 387 floating point coprocessor present majority of chips and emulated otherwise. Code compiled with this option will run almost everywhere. The temporary re- sults are computed in 80bit precision instead of precision specified by the type resulting in slightly different results compared to most of other chips.
  • Page 114 Chapter 4. GCC Command Options The usual calling convention has functions return values of types in an FPU float double register, even if there is no FPU. The idea is that the operating system should emulate an FPU. The option causes such values to be returned in ordinary CPU registers -mno-fp-ret-in-387 instead.
  • Page 115 Chapter 4. GCC Command Options Warning: this calling convention is incompatible with the one normally used on Unix, so you cannot use it if you need to call libraries compiled with the Unix compiler. Also, you must provide function prototypes for all functions that take variable numbers of argu- ments (including );...
  • Page 116 Chapter 4. GCC Command Options -mpush-args -mno-push-args Use PUSH operations to store outgoing parameters. This method is shorter and usually equally fast as method using SUB/MOV operations and is enabled by default. In some cases disabling it may improve performance because of improved scheduling and reduced dependencies. -maccumulate-outgoing-args If enabled, the maximum amount of space required for outgoing arguments will be computed in the function prologue.
  • Page 117: Options

    Chapter 4. GCC Command Options -mno-red-zone Do not use a so called red zone for x86-64 code. The red zone is mandated by the x86-64 ABI, it is a 128-byte area beyond the location of the stack pointer that will not be modified by signal or interrupt handlers and therefore can be used for temporary data without adjusting the stack pointer.
  • Page 118 Chapter 4. GCC Command Options -mb-step Generate code that works around Itanium B step errata. -mregister-names -mno-register-names Generate (or don’t) , and register names for the stacked registers. This may make assembler output more readable. -mno-sdata -msdata Disable (or enable) optimizations that use the small data section. This may be useful for working around optimizer bugs.
  • Page 119: S/390 And Zseries Options

    Chapter 4. GCC Command Options 4.17.5. S/390 and zSeries Options These are the options defined for the S/390 and zSeries architecture. -mhard-float -msoft-float Use (do not use) the hardware floating-point instructions and registers for floating-point operations. When is specified, functions in will be used to perform -msoft-float libgcc.a...
  • Page 120: Options For Code Generation Conventions

    Chapter 4. GCC Command Options -mdebug -mno-debug Print (or do not print) additional debug information when compiling. The default is to not print debug information. -march= cpu-type Generate code that will run on , which is the name of a system representing a certain cpu-type processor type.
  • Page 121 Chapter 4. GCC Command Options -fbounds-check For front-ends that support it, generate additional code to check that indices used to access arrays are within the declared range. This is currently only supported by the Java and Fortran 77 front- ends, where this option defaults to true and false respectively. -ftrapv This option generates traps for signed overflow on addition, subtraction, multiplication opera- tions.
  • Page 122 Chapter 4. GCC Command Options -freg-struct-return Return values in registers when possible. This is more efficient for small struct union structures than -fpcc-struct-return If you specify neither , GCC defaults to -fpcc-struct-return -freg-struct-return whichever convention is standard for the target. If there is no standard convention, GCC defaults , except on targets where GCC is the principal compiler.
  • Page 123 Chapter 4. GCC Command Options -fverbose-asm Put extra commentary information in the generated assembly code to make it more readable. This option is generally only of use to those who actually need to read the generated assembly code (perhaps while debugging the compiler itself). , the default, causes the extra information to be omitted and is useful when -fno-verbose-asm comparing two assembler files.
  • Page 124 Chapter 4. GCC Command Options -fcall-saved- Treat the register named as an allocable register saved by functions. It may be allocated even for temporaries or variables that live across a call. Functions compiled this way will save and restore the register if they use it.
  • Page 125 A good explanation of the benefits offered by ensuring ELF symbols have the correct visibil- ity is given by "How To Write Shared Libraries" by Ulrich Drepper (which can be found at http://people.redhat.com/~drepper/) - however a superior solution made possible by this option...
  • Page 126: Environment Variables Affecting Gcc

    Chapter 4. GCC Command Options to marking things hidden when the default is public is to make the default hidden and mark things public. This is the norm with DLL’s on Windows and with -fvisibility=hidden instead of __attribute__ ((visibility("default"))) __declspec(dllexport) get almost identical semantics with identical syntax.
  • Page 127 Chapter 4. GCC Command Options GCC_EXEC_PREFIX is set, it specifies a prefix to use in the names of the subprograms executed GCC_EXEC_PREFIX by the compiler. No slash is added when this prefix is combined with the name of a subprogram, but you can specify a prefix that ends with a slash if you wish.
  • Page 128: Using Precompiled Headers

    Chapter 4. GCC Command Options CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH Each variable’s value is a list of directories separated by a special character, much like , in PATH which to look for header files. The special character, , is target-dependent and PATH_SEPARATOR determined at GCC build time.
  • Page 129: Running Protoize

    Chapter 4. GCC Command Options before it looks for the include file in that directory. The name searched for is the name specified in the with appended. If the precompiled header file can’t be used, it is ignored. #include .gch For instance, if you have , and you have in the same directory as...
  • Page 130 Chapter 4. GCC Command Options When you run these programs, you must specify a set of source files as command line arguments. The conversion programs start out by compiling these files to see what functions they define. The information gathered about a file is saved in a file named After scanning comes actual conversion.
  • Page 131 Chapter 4. GCC Command Options precede the first function definition that contains a call to an undeclared function. This option applies only to protoize string Indent old-style parameter declarations with the string . This option applies only to string protoize converts prototyped function definitions to old-style function definitions, where unprotoize the arguments are declared between the argument list and the initial...
  • Page 132 Chapter 4. GCC Command Options...
  • Page 133: C Implementation-Defined Behavior

    Chapter 5. C Implementation-defined behavior A conforming implementation of ISO C is required to document its choice of behavior in each of the areas that are designated "implementation defined." The following lists all such areas, along with the section number from the ISO/IEC 9899:1999 standard. 5.1.
  • Page 134: Integers

    Chapter 5. C Implementation-defined behavior [The value of a wide character constant containing more than one multibyte character, or containing • a multibyte character or escape sequence not represented in the extended execution character set (6.4.4.4).] [The current locale used to convert a wide character constant consisting of a single multibyte char- •...
  • Page 135: Arrays And Pointers

    Chapter 5. C Implementation-defined behavior [Whether the "inexact" floating-point exception can be raised when the rounded result actually does • equal the mathematical result in an IEC 60559 conformant implementation (F.9).] [Whether the "underflow" (and "inexact") floating-point exception can be raised when a result is •...
  • Page 136: Qualifiers

    Chapter 5. C Implementation-defined behavior [Allowable bit-field types other than , and (6.7.2.1).] • _Bool signed int unsigned int [Whether a bit-field can straddle a storage-unit boundary (6.7.2.1).] • [The order of allocation of bit-fields within a unit (6.7.2.1).] • [The alignment of non-bit-field members of structures (6.7.2.1).] •...
  • Page 137: Architecture

    Chapter 5. C Implementation-defined behavior 5.13. Architecture [The values or expressions assigned to the macros specified in the headers • float.h , and (5.2.4.2, 7.18.2, 7.18.3).] limits.h stdint.h [The number, order, and encoding of bytes in any object (when not explicitly specified in this •...
  • Page 138 Chapter 5. C Implementation-defined behavior...
  • Page 139: Extensions To The C Language Family

    Chapter 6. Extensions to the C Language Family GNU C provides several language features not found in ISO standard C. (The option -pedantic directs GCC to print a warning message if any of these features is used.) To test for the availability of these features in conditional compilation, check for a predefined macro , which is always __GNUC__...
  • Page 140: Locally Declared Labels

    Chapter 6. Extensions to the C Language Family In G++, the result value of a statement expression undergoes array and function pointer decay, and is returned by value to the enclosing expression. For instance, if is a class, then A a; ({a;}).Foo () will construct a temporary object to hold the result of the statement expression, and that will be used...
  • Page 141: Labels As Values

    Chapter 6. Extensions to the C Language Family The label declaration defines the label name, but does not define the label itself. You must do this in the usual way, with , within the statements of the statement expression. label The local label feature is useful for complex macros.
  • Page 142: Nested Functions

    Chapter 6. Extensions to the C Language Family To use these values, you need to be able to jump to one. This is done with the computed goto state- ment . For example, goto * goto *ptr; Any expression of type is allowed.
  • Page 143 Chapter 6. Extensions to the C Language Family The nested function can access all the variables of the containing function that are visible at the point of its definition. This is called lexical scoping. For example, here we show a nested function which uses an inherited variable named offset bar (int *array, int offset, int size)
  • Page 144: Constructing Function Calls

    Chapter 6. Extensions to the C Language Family int access (int *array, int index) if (index size) goto failure; return array[index + offset]; int i; /* ... */ for (i = 0; i size; i++) /* ... */ access (array, i) /* ... */ /* ...
  • Page 145: Referring To A Type With

    Chapter 6. Extensions to the C Language Family void * (void (* )(), void * , size_t ) This built-in func- __builtin_apply function arguments size tion invokes with a copy of the parameters described by function arguments size The value of should be the value returned by .
  • Page 146: Generalized Lvalues

    Chapter 6. Extensions to the C Language Family Some more examples of the use of typeof This declares with the type of what points to. • typeof (*x) y; This declares as an array of such values. • typeof (*x) y[4]; This declares as an array of pointers to characters: •...
  • Page 147: Conditionals With Omitted Operands

    Chapter 6. Extensions to the C Language Family Similarly, the address of the compound expression can be taken. These two expressions are equivalent: &(a, b) a, &b A conditional expression is a valid lvalue if its type is not void and the true and false branches are both valid lvalues.
  • Page 148: Double-Word Integers

    Chapter 6. Extensions to the C Language Family has the value of if that is nonzero; otherwise, the value of This example is perfectly equivalent to x ? x : y In this simple case, the ability to omit the middle operand is not especially useful. When it becomes useful is when the first operand does, or may (if it is a macro argument), contain a side effect.
  • Page 149: Hex Floats

    Chapter 6. Extensions to the C Language Family The operator performs complex conjugation when used on a value with a complex type. This is a GNU extension; for values of floating type, you should use the ISO C99 functions conjf conj , declared in and also provided as built-in functions by GCC.
  • Page 150: Structures With No Members

    Chapter 6. Extensions to the C Language Family GCC versions before 3.0 allowed zero-length arrays to be statically initialized, as if they were flexible arrays. In addition to those cases that were useful, it also allowed initializations in situations that would corrupt later data.
  • Page 151 Chapter 6. Extensions to the C Language Family 6.14. Arrays of Variable Length Variable-length automatic arrays are allowed in ISO C99, and as an extension GCC accepts them in C89 mode and in C++. (However, GCC’s implementation of variable-length arrays does not yet conform in detail to the ISO C99 standard.) These arrays are declared like any other automatic arrays, but with a length that is not a constant expression.
  • Page 152: Macros With A Variable Number Of Arguments

    Chapter 6. Extensions to the C Language Family by the "real" parameter declarations. Each forward declaration must match a "real" declaration in parameter name and data type. ISO C99 does not support parameter forward declarations. 6.15. Macros with a Variable Number of Arguments. In the ISO C standard of 1999, a macro can be declared to accept a variable number of arguments much as a function can.
  • Page 153: Slightly Looser Rules For Escaped Newlines

    Chapter 6. Extensions to the C Language Family 6.16. Slightly Looser Rules for Escaped Newlines Recently, the preprocessor has relaxed its treatment of escaped newlines. Previously, the newline had to immediately follow a backslash. The current implementation allows whitespace in the form of spaces, horizontal and vertical tabs, and form feeds between the backslash and the subsequent newline.
  • Page 154: Compound Literals

    Chapter 6. Extensions to the C Language Family 6.20. Compound Literals ISO C99 supports compound literals. A compound literal looks like a cast containing an initializer. Its value is an object of the type specified in the cast, containing the elements specified in the initializer; it is an lvalue.
  • Page 155: Designated Initializers

    Chapter 6. Extensions to the C Language Family 6.21. Designated Initializers Standard C89 requires the elements of an initializer to appear in a fixed order, the same as the order of the elements in the array or structure being initialized. In ISO C99 you can give the elements in any order, specifying the array indices or structure field names they apply to, and GNU C allows this as an extension in C89 mode as well.
  • Page 156: Case Ranges

    Chapter 6. Extensions to the C Language Family is known as a designator. You can also use a designator (or the obsolete index fieldname colon syntax) when initializing a union, to specify which element of the union should be used. For example, union foo { int i;...
  • Page 157: Cast To A Union Type

    Chapter 6. Extensions to the C Language Family This has the same effect as the proper number of individual labels, one for each integer value case from , inclusive. high This feature is especially useful for ranges of ASCII character codes: case ’A’...
  • Page 158: Mixed Declarations And Code

    Chapter 6. Extensions to the C Language Family 6.24. Mixed Declarations and Code ISO C99 and ISO C++ allow declarations and code to be freely mixed within compound statements. As an extension, GCC also allows this in C89 mode. For example, you could do: int i;...
  • Page 159 Chapter 6. Extensions to the C Language Family The attribute is not implemented in GCC versions earlier than 2.5. An alternative way noreturn to declare that a function does not return, which works in the current version and in some older versions, is as follows: typedef void voidfn ();...
  • Page 160 Chapter 6. Extensions to the C Language Family format ( archetype string-index first-to-check attribute specifies that a function takes format printf scanf strftime strfmon style arguments which should be type-checked against a format string. For example, the declara- tion: extern int my_printf (void *my_object, const char *my_format, ...) __attribute__ ((format (printf, 2, 3)));...
  • Page 161 Chapter 6. Extensions to the C Language Family attribute allows you to identify your own functions which modify format format-arg strings, so that GCC can check the calls to type function printf scanf strftime strfmon whose operands are a call to one of your own function. The compiler always treats gettext , and in this manner except when strict ISO C support is requested by...
  • Page 162 Chapter 6. Extensions to the C Language Family used This attribute, attached to a function, means that code must be emitted for the function even if it appears that the function is not referenced. This is useful, for example, when the function is referenced only in inline assembly.
  • Page 163 Chapter 6. Extensions to the C Language Family visibility (" ") visibility_type attribute on ELF targets causes the declaration to be emitted with default, visibility hidden, protected or internal visibility. void __attribute__ ((visibility ("protected"))) f () { /* Do something. */; } int i __attribute__ ((visibility ("hidden")));...
  • Page 164 Chapter 6. Extensions to the C Language Family will pop the arguments off the stack. If the number of arguments is variable all arguments are pushed on the stack. cdecl On the Intel 386, the attribute causes the compiler to assume that the calling function cdecl will pop off the stack space used to pass arguments.
  • Page 165 Chapter 6. Extensions to the C Language Family sp_switch Use this attribute on the SH to indicate an function should switch to an interrupt_handler alternate stack. It expects a string argument that names a global variable holding the address of the alternate stack.
  • Page 166 Chapter 6. Extensions to the C Language Family On IA-64, use this attribute to set the addressability of an object. At present, the only supported identifier for , indicating addressability via "small" (22-bit) addresses (so model-name small that their addresses can be loaded with the instruction).
  • Page 167: Attribute Syntax

    Chapter 6. Extensions to the C Language Family Currently, the attribute is ignored for inlined functions, but export can be forced by dllexport using the flag. The attribute is also ignored for undefined sym- -fkeep-inline-functions bols. When applied to C++ classes. the attribute marks defined non-inlined member functions and static data members as exports.
  • Page 168 Chapter 6. Extensions to the C Language Family An identifier. For example, attributes use this form. mode • An identifier followed by a comma and a non-empty comma-separated list of expressions. For • example, attributes use this form. format A possibly empty comma-separated list of expressions. For example, attributes use format_arg •...
  • Page 169 Chapter 6. Extensions to the C Language Family An attribute specifier list may appear immediately before the comma, or semicolon terminating the declaration of an identifier other than a function definition. At present, such attribute specifiers apply to the declared object or function, but in future they may attach to the outermost adjacent declarator. In simple cases there is no difference, but, for example, in void (****f)(void) __attribute__((noreturn));...
  • Page 170: Prototypes And Old-Style Function Definitions

    Chapter 6. Extensions to the C Language Family For compatibility with existing code written for compiler versions that did not implement attributes on nested declarators, some laxity is allowed in the placing of attributes. If an attribute that only applies to types is applied to a declaration, it will be treated as applying to the type of that declaration.
  • Page 171: C++ Style Comments

    Chapter 6. Extensions to the C Language Family 6.28. C++ Style Comments In GNU C, you may use C++ style comments, which start with and continue until the end of the line. Many other C implementations allow such comments, and they are included in the 1999 C standard.
  • Page 172 Chapter 6. Extensions to the C Language Family aligned ( alignment This attribute specifies a minimum alignment for the variable or structure field, measured in bytes. For example, the declaration: int x __attribute__ ((aligned (16))) = 0; causes the compiler to allocate the global variable on a 16-byte boundary.
  • Page 173 Chapter 6. Extensions to the C Language Family deprecated attribute results in a warning if the variable is used anywhere in the source file. deprecated This is useful when identifying variables that are expected to be removed in a future version of a program.
  • Page 174 Chapter 6. Extensions to the C Language Family Use the attribute with an initialized definition of a global variable, as shown in the section example. GCC issues a warning and otherwise ignores the attribute in uninitialized section variable declarations. You may only use the attribute with a fully initialized global definition because of the section way linkers work.
  • Page 175: M32R/D Variable Attributes

    Chapter 6. Extensions to the C Language Family int foo __attribute__ ((vector_size (16))); causes the compiler to set the mode for , to be 16 bytes, divided into sized units. Assum- ing a 32-bit int (a vector of 4 units of 4 bytes), the corresponding mode of will be V4SI.
  • Page 176: Specifying Attributes Of Types

    Chapter 6. Extensions to the C Language Family 6.33. Specifying Attributes of Types The keyword allows you to specify special attributes of __attribute__ struct union types when you define such types. This keyword is followed by an attribute specification inside double parentheses. Six attributes are currently defined for types: aligned packed .
  • Page 177 Chapter 6. Extensions to the C Language Family Note that although you can ask the compiler to select a time-efficient alignment for a given type and then declare only individual stand-alone objects of that type, the compiler’s ability to select a time-efficient alignment is primarily useful only when you plan to create arrays of variables having the relevant (efficiently aligned) type.
  • Page 178 Chapter 6. Extensions to the C Language Family must have the same machine representation; this is necessary for this argument passing to work properly. Transparent unions are designed for library functions that have multiple interfaces for compati- bility reasons. For example, suppose the function must accept either a value of type wait int *...
  • Page 179: I386 Type Attributes

    Chapter 6. Extensions to the C Language Family may_alias Accesses to objects with types with this attribute are not subjected to type-based alias analysis, but are instead assumed to be able to alias any other type of objects, just like the type.
  • Page 180 Chapter 6. Extensions to the C Language Family inline int inc (int *a) (*a)++; (If you are writing a header file to be included in ISO C programs, write instead of __inline__ . Section 6.39 Alternate Keywords.) You can also make all "simple enough" functions inline inline with the option -finline-functions...
  • Page 181: Assembler Instructions With C Expression Operands

    Chapter 6. Extensions to the C Language Family 6.35. Assembler Instructions with C Expression Operands In an assembler instruction using , you can specify the operands of the instruction using C expres- sions. This means you need not guess which registers or memory locations will contain the data you want to use.
  • Page 182 Chapter 6. Extensions to the C Language Family expression for both operands, or different expressions. For example, here we write the (fictitious) instruction with as its read-only source operand and as its read-write destination: combine asm ("combine %2,%0" : "=r" (foo) : "0" (foo), "g" (bar)); The constraint for operand 1 says that it must occupy the same location as operand 0.
  • Page 183 Chapter 6. Extensions to the C Language Family to name this register. On other machines, the condition code is handled differently, and specifying has no effect. But it is valid no matter what the machine. If your assembler instructions access memory in an unpredictable fashion, add to the list of memory clobbered registers.
  • Page 184 Chapter 6. Extensions to the C Language Family This assumes your assembler supports local labels, as the GNU assembler and most Unix assemblers Speaking of labels, jumps from one to another are not supported. The compiler’s optimizers do not know about these jumps, and therefore they cannot take account of them when deciding how to optimize.
  • Page 185: Size Of An Asm

    Chapter 6. Extensions to the C Language Family Assume contains the address of a memory mapped device register. The PowerPC addr eieio struction (Enforce In-order Execution of I/O) tells the CPU to make sure that the store to that device register happens before it issues any other I/O.
  • Page 186: Constraints For Asm Operands

    Chapter 6. Extensions to the C Language Family It is possible that if an input dies in an insn, reload might use the input reg for an output reload. Consider this example: asm ("foo" : "=t" (a) : "f" (b)); This asm says that input B is not popped by the asm, and that the asm pushes a result onto the reg-stack, i.e., the stack is one deeper after the asm than it was before.
  • Page 187 Chapter 6. Extensions to the C Language Family whitespace Whitespace characters are ignored and can be inserted at any position except the first. This en- ables each alternative for different operands to be visually aligned in the machine description even if they have different number of constraints and modifiers. A memory operand is allowed, with any kind of address that the machine supports in general.
  • Page 188 Chapter 6. Extensions to the C Language Family , . . . Other letters in the range through may be defined in a machine-dependent fashion to permit immediate integer operands with explicit integer values in specified ranges. For example, on the 68000, is defined to stand for the range of values 1 to 8.
  • Page 189: Multiple Alternative Constraints

    Chapter 6. Extensions to the C Language Family Matching constraints are used in these circumstances. More precisely, the two operands that match must include one input-only operand and one output-only operand. Moreover, the digit must be a smaller number than the number of the operand that uses it in the constraint. An operand that is a valid memory address is allowed.
  • Page 190: Constraints For Particular Machines

    Chapter 6. Extensions to the C Language Family Means that this operand is both read and written by the instruction. When the compiler fixes up the operands to satisfy the constraints, it needs to know which operands are inputs to the instruction and which are outputs from it. identifies an output;...
  • Page 191 Chapter 6. Extensions to the C Language Family REG_CLASS_FROM_LETTER Register class constraints (usually lowercase). CONST_OK_FOR_LETTER_P Immediate constant constraints, for non-floating point constants of word size or smaller precision (usually uppercase). CONST_DOUBLE_OK_FOR_LETTER_P Immediate constant constraints, for all floating point constants and for constants of greater than word size precision (usually uppercase).
  • Page 192 Chapter 6. Extensions to the C Language Family An item in the constant pool A symbol in the text segment of the current file AVR family-- avr.h Registers from r0 to r15 Registers from r16 to r23 Registers from r16 to r31 Registers from r24 to r31.
  • Page 193 Chapter 6. Extensions to the C Language Family Constant integer 2 Constant integer 0 Constant that fits in 8 bits Constant integer -1 Constant integer 8, 16, or 24 Constant integer 1 A floating point constant 0.0 PowerPC and IBM RS6000-- rs6000.h Address base register Floating point register...
  • Page 194 Chapter 6. Extensions to the C Language Family register (condition register) stack memory for FPR-GPR transfers FPMEM Signed 16-bit constant Unsigned 16-bit constant shifted left 16 bits (use instead for constants) SImode Unsigned 16-bit constant Signed 16-bit constant shifted left 16 bits Constant larger than 31 Exact power of 2 Zero...
  • Page 195 Chapter 6. Extensions to the C Language Family Intel 386-- i386.h , or register for the i386. For x86-64 it is equivalent to class. (for 8-bit instructions that do not use upper halves) , or register. (for 8-bit instructions, that do use upper halves) Legacy register--equivalent to class in i386 mode.
  • Page 196 Chapter 6. Extensions to the C Language Family SSE register MMX register Constant in range 0 to 31 (for 32-bit shifts) Constant in range 0 to 63 (for 64-bit shifts) 0xff 0xffff 0, 1, 2, or 3 (shifts for instruction) Constant in range 0 to 255 (for instruction) Constant in range 0 to...
  • Page 197 Chapter 6. Extensions to the C Language Family Any local or global register Integers from 0 to 31 Integers from -31 to 0 Floating point 0 Floating point 1 Intel IA-64-- ia64.h General register instruction addl Branch register Predicate register ( as in "conditional") Application register residing in M-unit Application register residing in I-unit...
  • Page 198 Chapter 6. Extensions to the C Language Family 22-bit signed integer constant 8-bit signed integer constant for logical instructions 8-bit adjusted signed integer constant for compare pseudo-ops 6-bit unsigned integer constant for shift counts 9-bit signed integer constant for load and store postincrements The constant zero 0 or -1 for instruction...
  • Page 199 Chapter 6. Extensions to the C Language Family register register register registers (offsettable address) Non-pointer registers (not Non-SP registers (everything except Indirect through - Avoid this except for , since we can’t access extra bytes QImode Indirect through with short displacement (0..127) Data-section immediate value Integers from -255 to -1 Integers from 0 to 7--valid bit number in a register...
  • Page 200 Chapter 6. Extensions to the C Language Family Integers from 0 to 255 MIPS-- mips.h General-purpose integer register Floating-point register (if available) register register register General-purpose integer register Floating-point status register Signed 16-bit constant (for arithmetic instructions) Zero Zero-extended 16-bit constant (for logic instructions) Constant with low 16 bits zero (can be loaded with 32-bit constant which requires two instructions to load (a constant which is not , or...
  • Page 201 Chapter 6. Extensions to the C Language Family Positive 16-bit constant Floating point zero Memory reference that can be loaded with more than one instruction ( is preferable for statements) Memory reference that can be loaded with one instruction ( is preferable for state- ments)
  • Page 202 Chapter 6. Extensions to the C Language Family Motorola 68HC11 & 68HC12 families-- m68hc11.h Register ’a’ Register ’b’ Register ’d’ An 8-bit register Temporary soft register _.tmp A soft register _.d1 to _.d31 Stack pointer register Register ’x’ Register ’y’ Pseudo register ’z’...
  • Page 203 Chapter 6. Extensions to the C Language Family Constant integer 1 or -1 Constant integer 16 Constants in the range -8 to 2 SPARC-- sparc.h Floating-point register on the SPARC-V8 architecture and lower floating-point register on the SPARC-V9 architecture. Floating-point register. It is equivalent to on the SPARC-V8 architecture and contains both lower and upper floating-point registers on the SPARC-V9 architecture.
  • Page 204 Chapter 6. Extensions to the C Language Family Same as , except that it verifies that bits that are not in the lower 32-bit range are all zero. Must be used instead of for modes wider than SImode The constant 4096 Floating-point zero Signed 13-bit constant, sign-extended to 32 or 64 bits Floating-point constant whose integral representation can be moved into an integer register...
  • Page 205 Chapter 6. Extensions to the C Language Family Block count register (bk) Extended (40-bit) precision low register (r0-r7) Extended (40-bit) precision register (r0-r1) Extended (40-bit) precision register (r2-r3) Repeat count register (rc) Index register (ir0-ir1) Status (condition code) register (st) Data page register (dp) Floating-point zero Immediate 16-bit floating-point constant...
  • Page 206 Chapter 6. Extensions to the C Language Family Indirect memory reference with signed 8-bit or index register displacement Indirect memory reference with unsigned 5-bit displacement Indirect memory reference with 1 bit or index register displacement Direct memory reference Symbolic address S/390 and zSeries-- s390.h Address register (general purpose register except r0)
  • Page 207 Chapter 6. Extensions to the C Language Family Constant integer with a value of 0x7fffffff. Multiple letter constraint followed by 4 parameter letters. 0..9: number of the part counting from most to least significant H,Q: mode of the part D,S,H: mode of the containing operand 0,F: value of the other parts (F - all bits set)
  • Page 208 Chapter 6. Extensions to the C Language Family Register r1. Register r2. Register r8. Registers r0 through r7. Registers r0 and r1. The carry register. Registers r8 and r9. A constant between 0 and 3 inclusive. A constant that has exactly one bit set. A constant that has exactly one bit clear.
  • Page 209: Controlling Names Used In Assembler Code

    Chapter 6. Extensions to the C Language Family A memory reference that refers to a constant address of known value. The register indicated by Rx (not implemented yet). A constant that is not between 2 and 15 inclusive. The constant 0. Xtensa-- xtensa.h General-purpose 32-bit register...
  • Page 210: Variables In Specified Registers

    Chapter 6. Extensions to the C Language Family On systems where an underscore is normally prepended to the name of a C function or variable, this feature allows you to define names for the linker that do not start with an underscore. It does not make sense to use this feature with a non-static local variable since such variables do not have assembler names.
  • Page 211: Specifying Registers For Local Variables

    Chapter 6. Extensions to the C Language Family type. On machines with register windows, be sure to choose a "global" register that is not affected magically by the function call mechanism. In addition, operating systems on one type of cpu may differ in how they name the registers; then you would need additional conditionals.
  • Page 212: Alternate Keywords

    Chapter 6. Extensions to the C Language Family register int *foo asm ("a5"); Here is the name of the register which should be used. Note that this is the same syntax used for defining global register variables, but for a local variable it would appear within a function. Naturally the register name is cpu-dependent, but this is not a problem, since specific registers are most often useful with explicit assembler instructions (Section 6.35 Assembler Instructions with C Expression Operands).
  • Page 213: Incomplete Enum Types

    Chapter 6. Extensions to the C Language Family 6.40. Incomplete Types enum You can define an tag without specifying its possible values. This results in an incomplete type, enum much like what you get if you write without describing the elements. A later declaration struct foo which does specify the possible values completes the type.
  • Page 214: Getting The Return Or Frame Address Of A Function

    Chapter 6. Extensions to the C Language Family a ax; ax.sub (0); return 0; gives this output: __FUNCTION__ = sub __PRETTY_FUNCTION__ = void a::sub(int) These identifiers are not preprocessor macros. In GCC 3.3 and earlier, in C only, __FUNCTION__ were treated as string literals; they could be used to initialize arrays, __PRETTY_FUNCTION__ char...
  • Page 215: Using Vector Instructions Through Built-In Functions

    Chapter 6. Extensions to the C Language Family 6.43. Using vector instructions through built-in functions On some targets, the instruction set contains SIMD vector instructions that operate on multiple values contained in one large register at the same time. For example, on the i386 the MMX, 3Dnow! and SSE extensions can be used this way.
  • Page 216: Object Size Checking Builtins

    Chapter 6. Extensions to the C Language Family Subtraction, multiplication, division, and the logical operations operate in a similar manner. Likewise, the result of using the unary minus or complement operators on a vector type is a vector whose elements are the negative or complemented values of the corresponding elements in the operand. You can declare variables and use them in function calls and returns, as well as in assignments and some casts.
  • Page 217: Other Built-In Functions Provided By Gcc

    Chapter 6. Extensions to the C Language Family is the number of bytes remaining in object the argument points to or if the size dest (size_t) -1 is not known. The built-in functions are optimized into the normal string functions like if the last argument memcpy or if it is known at compile time that the destination object will not be overflown.
  • Page 218 Chapter 6. Extensions to the C Language Family 6.45. Other built-in functions provided by GCC GCC provides a large number of built-in functions other than the ones mentioned above. Some of these are for internal use in the processing of exceptions or variable-length argument lists and will not be documented here because they may change from time to time;...
  • Page 219 Chapter 6. Extensions to the C Language Family GCC provides built-in versions of the ISO C99 floating point comparison macros that avoid raising exceptions for unordered operands. They have the same names as the standard macros ( isgreater , and ) , with isgreaterequal isless...
  • Page 220 Chapter 6. Extensions to the C Language Family #define foo(x) __builtin_choose_expr ( __builtin_types_compatible_p (typeof (x), double), foo_double (x), __builtin_choose_expr ( __builtin_types_compatible_p (typeof (x), float), foo_float (x), /* The void expression results in a compile-time error when assigning the result to something. (void)0)) Note: This construct is only available for C.
  • Page 221 Chapter 6. Extensions to the C Language Family The return value is the value of , which should be an integral expression. The value of must be a compile-time constant. The semantics of the built-in are that it is expected that .
  • Page 222 Chapter 6. Extensions to the C Language Family double (void) Similar to , except a warning is generated if __builtin_inf __builtin_huge_val the target floating-point format does not support infinities. This function is suitable for implementing the ISO C99 macro INFINITY float (void) Similar to , except the return type is...
  • Page 223: Built-In Functions Specific To Particular Target Machines

    Chapter 6. Extensions to the C Language Family (unsigned long long) Similar to , except the argument type __builtin_clzll __builtin_clz unsigned long long (unsigned long long) Similar to , except the argument type __builtin_ctzll __builtin_ctz unsigned long long (unsigned long long) Similar to , except the ar- __builtin_popcountll __builtin_popcount...
  • Page 224 Chapter 6. Extensions to the C Language Family v8qi __builtin_ia32_pcmpgtb (v8qi, v8qi) v4hi __builtin_ia32_pcmpgtw (v4hi, v4hi) v2si __builtin_ia32_pcmpgtd (v2si, v2si) v8qi __builtin_ia32_punpckhbw (v8qi, v8qi) v4hi __builtin_ia32_punpckhwd (v4hi, v4hi) v2si __builtin_ia32_punpckhdq (v2si, v2si) v8qi __builtin_ia32_punpcklbw (v8qi, v8qi) v4hi __builtin_ia32_punpcklwd (v4hi, v4hi) v2si __builtin_ia32_punpckldq (v2si, v2si) v8qi __builtin_ia32_packsswb (v4hi, v4hi) v4hi __builtin_ia32_packssdw (v2si, v2si)
  • Page 225 Chapter 6. Extensions to the C Language Family v4si __builtin_ia32_cmpgtps (v4sf, v4sf) v4si __builtin_ia32_cmpgeps (v4sf, v4sf) v4si __builtin_ia32_cmpunordps (v4sf, v4sf) v4si __builtin_ia32_cmpneqps (v4sf, v4sf) v4si __builtin_ia32_cmpnltps (v4sf, v4sf) v4si __builtin_ia32_cmpnleps (v4sf, v4sf) v4si __builtin_ia32_cmpngtps (v4sf, v4sf) v4si __builtin_ia32_cmpngeps (v4sf, v4sf) v4si __builtin_ia32_cmpordps (v4sf, v4sf) v4si __builtin_ia32_cmpeqss (v4sf, v4sf) v4si __builtin_ia32_cmpltss (v4sf, v4sf)
  • Page 226 Chapter 6. Extensions to the C Language Family void __builtin_ia32_storeups (float *, v4sf) Generates the machine instruction as a store to memory. movups v4sf __builtin_ia32_loadsss (float *) Generates the machine instruction as a load from memory. movss void __builtin_ia32_storess (float *, v4sf) Generates the machine instruction as a store to memory.
  • Page 227: Powerpc Altivec Built-In Functions

    Chapter 6. Extensions to the C Language Family v2sf __builtin_ia32_pfmax (v2sf, v2sf) v2sf __builtin_ia32_pfmin (v2sf, v2sf) v2sf __builtin_ia32_pfmul (v2sf, v2sf) v2sf __builtin_ia32_pfrcp (v2sf) v2sf __builtin_ia32_pfrcpit1 (v2sf, v2sf) v2sf __builtin_ia32_pfrcpit2 (v2sf, v2sf) v2sf __builtin_ia32_pfrsqrt (v2sf) v2sf __builtin_ia32_pfrsqrtit1 (v2sf, v2sf) v2sf __builtin_ia32_pfsub (v2sf, v2sf) v2sf __builtin_ia32_pfsubr (v2sf, v2sf) v2sf __builtin_ia32_pi2fd (v2si) v4hi __builtin_ia32_pmulhrw (v4hi, v4hi)
  • Page 228 Chapter 6. Extensions to the C Language Family is omitted, the vector type defaults to • signed unsigned signed vector int vector and to short unsigned vector char Compiling with adds keywords , and . Macros • -maltivec __vector __pixel __bool vector , and...
  • Page 229 Chapter 6. Extensions to the C Language Family vector unsigned int vec_vadduwm (vector bool int, vector unsigned int); vector unsigned int vec_vadduwm (vector unsigned int, vector bool int); vector unsigned int vec_vadduwm (vector unsigned int, vector unsigned int); vector signed short vec_vadduhm (vector bool short, vector signed short);...
  • Page 230 Chapter 6. Extensions to the C Language Family vector signed short vec_vaddshs (vector bool short, vector signed short); vector signed short vec_vaddshs (vector signed short, vector bool short); vector signed short vec_vaddshs (vector signed short, vector signed short); vector unsigned short vec_vadduhs (vector bool short, vector unsigned short);...
  • Page 231 Chapter 6. Extensions to the C Language Family vector unsigned int vec_andc (vector unsigned int, vector bool int); vector unsigned int vec_andc (vector unsigned int, vector unsigned int); vector bool short vec_andc (vector bool short, vector bool short); vector signed short vec_andc (vector bool short, vector signed short); vector signed short vec_andc (vector signed short, vector bool short);...
  • Page 232 Chapter 6. Extensions to the C Language Family vector bool int vec_vcmpequw (vector unsigned int, vector unsigned int); vector bool short vec_vcmpequh (vector signed short, vector signed short); vector bool short vec_vcmpequh (vector unsigned short, vector unsigned short); vector bool char vec_vcmpequb (vector signed char, vector signed char); vector bool char vec_vcmpequb (vector unsigned char, vector unsigned char);...
  • Page 233 Chapter 6. Extensions to the C Language Family void vec_dssall (void); void vec_dst (const vector unsigned char *, int, const int); void vec_dst (const vector signed char *, int, const int); void vec_dst (const vector bool char *, int, const int); void vec_dst (const vector unsigned short *, int, const int);...
  • Page 234 Chapter 6. Extensions to the C Language Family void vec_dststt (const unsigned long *, int, const int); void vec_dststt (const long *, int, const int); void vec_dststt (const float *, int, const int); void vec_dstt (const vector unsigned char *, int, const int); void vec_dstt (const vector signed char *, int, const int);...
  • Page 235 Chapter 6. Extensions to the C Language Family vector unsigned int vec_lvewx (int, unsigned int *); vector signed int vec_lvewx (int, long *); vector unsigned int vec_lvewx (int, unsigned long *); vector signed short vec_lvehx (int, short *); vector unsigned short vec_lvehx (int, unsigned short *); vector signed char vec_lvebx (int, char *);...
  • Page 236 Chapter 6. Extensions to the C Language Family vector unsigned char); vector signed char vec_max (vector bool char, vector signed char); vector signed char vec_max (vector signed char, vector bool char); vector signed char vec_max (vector signed char, vector signed char); vector unsigned short vec_max (vector bool short, vector unsigned short);...
  • Page 237 Chapter 6. Extensions to the C Language Family vector signed short); vector unsigned short vec_mergeh (vector unsigned short, vector unsigned short); vector float vec_mergeh (vector float, vector float); vector bool int vec_mergeh (vector bool int, vector bool int); vector signed int vec_mergeh (vector signed int, vector signed int); vector unsigned int vec_mergeh (vector unsigned int, vector unsigned int);...
  • Page 238 Chapter 6. Extensions to the C Language Family vector unsigned char vec_min (vector bool char, vector unsigned char); vector unsigned char vec_min (vector unsigned char, vector bool char); vector unsigned char vec_min (vector unsigned char, vector unsigned char); vector signed char vec_min (vector bool char, vector signed char); vector signed char vec_min (vector signed char, vector bool char);...
  • Page 239 Chapter 6. Extensions to the C Language Family vector signed short vec_mladd (vector signed short, vector unsigned short, vector unsigned short); vector signed short vec_mladd (vector unsigned short, vector signed short, vector signed short); vector unsigned short vec_mladd (vector unsigned short, vector unsigned short, vector unsigned short);...
  • Page 240 Chapter 6. Extensions to the C Language Family void vec_mtvscr (vector unsigned short); void vec_mtvscr (vector bool short); void vec_mtvscr (vector pixel); void vec_mtvscr (vector signed char); void vec_mtvscr (vector unsigned char); void vec_mtvscr (vector bool char); vector unsigned short vec_mule (vector unsigned char, vector unsigned char);...
  • Page 241 Chapter 6. Extensions to the C Language Family vector float vec_or (vector float, vector bool int); vector float vec_or (vector bool int, vector float); vector bool int vec_or (vector bool int, vector bool int); vector signed int vec_or (vector bool int, vector signed int); vector signed int vec_or (vector signed int, vector bool int);...
  • Page 242 Chapter 6. Extensions to the C Language Family vector unsigned char vec_vpkuhus (vector unsigned short, vector unsigned short); vector unsigned char vec_packsu (vector unsigned short, vector unsigned short); vector unsigned char vec_packsu (vector signed short, vector signed short); vector unsigned short vec_packsu (vector unsigned int, vector unsigned int);...
  • Page 243 Chapter 6. Extensions to the C Language Family vector unsigned int vec_rl (vector unsigned int, vector unsigned int); vector signed int vec_vrlw (vector signed int, vector unsigned int); vector unsigned int vec_vrlw (vector unsigned int, vector unsigned int); vector signed short vec_vrlh (vector signed short, vector unsigned short);...
  • Page 244 Chapter 6. Extensions to the C Language Family vector unsigned char vec_sel (vector unsigned char, vector unsigned char, vector bool char); vector unsigned char vec_sel (vector unsigned char, vector unsigned char, vector unsigned char); vector bool char vec_sel (vector bool char, vector bool char, vector bool char);...
  • Page 245 Chapter 6. Extensions to the C Language Family const int); vector bool char vec_sld (vector bool char, vector bool char, const int); vector signed int vec_sll (vector signed int, vector unsigned int); vector signed int vec_sll (vector signed int, vector unsigned short); vector signed int vec_sll (vector signed int, vector unsigned char);...
  • Page 246 Chapter 6. Extensions to the C Language Family vector unsigned short vec_slo (vector unsigned short, vector signed char); vector unsigned short vec_slo (vector unsigned short, vector unsigned char); vector pixel vec_slo (vector pixel, vector signed char); vector pixel vec_slo (vector pixel, vector unsigned char); vector signed char vec_slo (vector signed char, vector signed char);...
  • Page 247 Chapter 6. Extensions to the C Language Family vector signed short vec_vsrh (vector signed short, vector unsigned short); vector unsigned short vec_vsrh (vector unsigned short, vector unsigned short); vector signed char vec_vsrb (vector signed char, vector unsigned char); vector unsigned char vec_vsrb (vector unsigned char, vector unsigned char);...
  • Page 248 Chapter 6. Extensions to the C Language Family vector unsigned char vec_srl (vector unsigned char, vector unsigned int); vector unsigned char vec_srl (vector unsigned char, vector unsigned short); vector unsigned char vec_srl (vector unsigned char, vector unsigned char); vector bool char vec_srl (vector bool char, vector unsigned int); vector bool char vec_srl (vector bool char, vector unsigned short);...
  • Page 249 Chapter 6. Extensions to the C Language Family void vec_ste (vector unsigned short, int, unsigned short *); void vec_ste (vector bool short, int, short *); void vec_ste (vector bool short, int, unsigned short *); void vec_ste (vector pixel, int, short *); void vec_ste (vector pixel, int, unsigned short *);...
  • Page 250 Chapter 6. Extensions to the C Language Family vector unsigned char); vector signed short vec_sub (vector bool short, vector signed short); vector signed short vec_sub (vector signed short, vector bool short); vector signed short vec_sub (vector signed short, vector signed short); vector unsigned short vec_sub (vector bool short, vector unsigned short);...
  • Page 251 Chapter 6. Extensions to the C Language Family vector unsigned short vec_subs (vector unsigned short, vector bool short); vector unsigned short vec_subs (vector unsigned short, vector unsigned short); vector signed short vec_subs (vector bool short, vector signed short); vector signed short vec_subs (vector signed short, vector bool short); vector signed short vec_subs (vector signed short, vector signed short);...
  • Page 252 Chapter 6. Extensions to the C Language Family vector signed int vec_sums (vector signed int, vector signed int); vector float vec_trunc (vector float); vector signed short vec_unpackh (vector signed char); vector bool short vec_unpackh (vector bool char); vector signed int vec_unpackh (vector signed short); vector bool int vec_unpackh (vector bool short);...
  • Page 253 Chapter 6. Extensions to the C Language Family int vec_all_eq (vector signed char, vector signed char); int vec_all_eq (vector unsigned char, vector bool char); int vec_all_eq (vector unsigned char, vector unsigned char); int vec_all_eq (vector bool char, vector bool char); int vec_all_eq (vector bool char, vector unsigned char);...
  • Page 254 Chapter 6. Extensions to the C Language Family int vec_all_in (vector float, vector float); int vec_all_le (vector bool char, vector unsigned char); int vec_all_le (vector unsigned char, vector bool char); int vec_all_le (vector unsigned char, vector unsigned char); int vec_all_le (vector bool char, vector signed char); int vec_all_le (vector signed char, vector bool char);...
  • Page 255 Chapter 6. Extensions to the C Language Family int vec_all_ne (vector unsigned int, vector bool int); int vec_all_ne (vector unsigned int, vector unsigned int); int vec_all_ne (vector bool int, vector bool int); int vec_all_ne (vector bool int, vector unsigned int); int vec_all_ne (vector bool int, vector signed int);...
  • Page 256 Chapter 6. Extensions to the C Language Family int vec_any_gt (vector unsigned char, vector bool char); int vec_any_gt (vector unsigned char, vector unsigned char); int vec_any_gt (vector bool char, vector signed char); int vec_any_gt (vector signed char, vector bool char); int vec_any_gt (vector signed char, vector signed char);...
  • Page 257: Pragmas Accepted By Gcc

    Chapter 6. Extensions to the C Language Family int vec_any_ne (vector signed char, vector signed char); int vec_any_ne (vector unsigned char, vector bool char); int vec_any_ne (vector unsigned char, vector unsigned char); int vec_any_ne (vector bool char, vector bool char); int vec_any_ne (vector bool char, vector unsigned char);...
  • Page 258: Darwin Pragmas

    Chapter 6. Extensions to the C Language Family longcall (0) Do not apply the attribute to subsequent function declarations. longcall 6.47.2. Darwin Pragmas The following pragmas are available for all architectures running the Darwin operating system. These are useful for compatibility with other Mac OS compilers. mark tokens This pragma is accepted, but has no effect.
  • Page 259: Thread-Local Storage

    In C++, if an initializer is present for a thread-local variable, it must be a constant-expression as defined in 5.19.2 of the ANSI/ISO C++ standard. See http://people.redhat.com/drepper/tls.pdfELF Handling For Thread-Local Storage for a detailed explanation of the four thread-local storage addressing models, and how the run-time is expected to function.
  • Page 260: Iso/Iec 14882:1998 Edits For Thread-Local Storage

    Chapter 6. Extensions to the C Language Family [6.2.4 Storage durations of objects] • Add new text before paragraph 3 An object whose identifier is declared with the storage-class specifier has thread storage __thread duration. Its lifetime is the entire execution of the thread, and its stored value is initialized only once, prior to thread startup.
  • Page 261 Chapter 6. Extensions to the C Language Family [basic.start.term] • Add after paragraph 3 The type of an object with thread storage duration shall not have a non-trivial destructor, nor shall it be an array type whose elements (directly or indirectly) have non-trivial destructors. [basic.stc] •...
  • Page 262 Chapter 6. Extensions to the C Language Family...
  • Page 263: Extensions To The C++ Language

    Chapter 7. Extensions to the C++ Language The GNU compiler provides these extensions to the C++ language (and you can also use most of the C language extensions in your C++ programs). If you want to write code that checks whether these features are available, you can test for the GNU compiler the same way as for C programs: check for a predefined macro .
  • Page 264: Restricting Pointer Aliasing

    Chapter 7. Extensions to the C++ Language volatile int *dst = somevalue volatile int *src = someothervalue *dst = *src; will cause a read of the volatile object pointed to by and stores the value into the volatile object pointed to by .
  • Page 265: Vague Linkage

    Chapter 7. Extensions to the C++ Language In the body of points to an unaliased integer and refers to a (different) unaliased rptr rref integer. You may also specify whether a member function’s pointer is unaliased by using this as a member function qualifier. __restrict__ void T::fn () __restrict__ /* ...
  • Page 266: Pragma Interface And Implementation

    Chapter 7. Extensions to the C++ Language dynamic type of a class object at runtime. For all other types, we write out the type_info object when it is used: when applying to an expression, throwing an object, or referring to a typeid type in a catch clause or exception specification.
  • Page 267: Where's The Template

    Chapter 7. Extensions to the C++ Language If you use with no argument, it applies to an include file with #pragma implementation the same basename as your source file. For example, in , giving just allclass.cc #pragma by itself is equivalent to implementation #pragma implementation "allclass.h"...
  • Page 268 Chapter 7. Extensions to the C++ Language complexity, and thus potential for error; for some code this can be just as transparent, but in practice it can been very difficult to build multiple programs in one directory and one program in multiple directories.
  • Page 269: Extracting The Function Pointer From A Bound Pointer To Member Function

    Chapter 7. Extensions to the C++ Language and instantiation of only the static data members of a template class, without the support data or member functions (with ( static extern template int max (int, int); inline template class Foo int ; static template class Foo int ;...
  • Page 270: Strong Using

    Chapter 7. Extensions to the C++ Language specifying a relative , a constant integral expression currently bounded between 101 priority and 65535 inclusive. Lower numbers indicate a higher priority. In the following example, would normally be created before , but the init_priority tribute has reversed that order: Some_Class...
  • Page 271: Offsetof

    Chapter 7. Extensions to the C++ Language 7.10. Offsetof G++ uses a syntactic extension to implement the macro. offsetof In particular: __offsetof__ (expression) is equivalent to the parenthesized expression, except that the expression is considered an integral constant expression even if it contains certain operators that are not normally permitted in an in- tegral constant expression.
  • Page 272: Backwards Compatibility

    Chapter 7. Extensions to the C++ Language -fexternal-templates -falt-external-templates These are two of the many ways for G++ to implement template instantiation. Section 7.6 Where’s the Template?. The C++ standard clearly defines how template definitions have to be organized across implementation units. G++ has an implicit instantiation mechanism that should work just fine for standard-conforming code.
  • Page 273: Gnu Objective-C Runtime Features

    Chapter 8. GNU Objective-C runtime features This document is meant to describe some of the GNU Objective-C runtime features. It is not intended to teach you Objective-C, there are several resources on the Internet that present the language. Ques- tions and comments about this document to Ovidiu Predescu mailto:ovidiu@@cup.hp.com. 8.1.
  • Page 274: Type Encoding

    Chapter 8. GNU Objective-C runtime features @end is a method that is not overridden by categories. If a class and a category of it both imple- +load ment , both methods are invoked. This allows some additional initializations to be performed +load in a category.
  • Page 275 Chapter 8. GNU Objective-C runtime features unsigned short unsigned int long unsigned long long long unsigned long long float double void Class char* unknown type bit-fields followed by the starting position of the bit-field, the type of the bit-field and the size of the bit-field (the bit-fields encoding was changed from the NeXT’s compiler encoding, see below) The encoding of bit-fields has changed to allow bit-fields to be properly handled by the runtime functions that compute sizes and alignments of types that contain bit-fields.
  • Page 276: Garbage Collection

    Chapter 8. GNU Objective-C runtime features int a[10]; [10i] struct { int i; {?=i[3f]b128i3b131i2c} float f[3]; int a:3; int b:2; char c; } In addition to the types the compiler also encodes the type specifiers. The table below describes the encoding of the current Objective-C type specifiers: Specifier Encoding...
  • Page 277: Constant String Objects

    Chapter 8. GNU Objective-C runtime features - initWithPointer:(const void*)p; - (const void*)weakPointer; @end @implementation WeakPointer + (void)initialize class_ivar_set_gcinvisible (self, "weakPointer", YES); - initWithPointer:(const void*)p weakPointer = p; return self; - (const void*)weakPointer return weakPointer; @end Weak pointers are supported through a new type character specifier represented by the character.
  • Page 278: Compatibility_Alias

    Chapter 8. GNU Objective-C runtime features inherits from ; user class libraries may choose to inherit the customized NXConstantString Object constant string class from a different class than . There is no requirement in the methods the Object constant string class has to implement, but the final ivar layout of the class must be the compatible with the given structure.
  • Page 279: Binary Compatibility

    Chapter 9. Binary Compatibility Binary compatibility encompasses several related concepts: application binary interface (ABI) The set of runtime conventions followed by all of the tools that deal with binary representations of a program, including compilers, assemblers, linkers, and language runtime support. Some ABIs are formal with a written specification, possibly designed by multiple interested parties.
  • Page 280 Chapter 9. Binary Compatibility interfaces for runtime arithmetic support • object file formats • In addition, the application binary interface implemented by a C++ compiler affects code generation and runtime support for: name mangling • exception handling • invoking constructors and destructors •...
  • Page 281 Chapter 9. Binary Compatibility also be necessary to specify different startup files and other runtime support libraries, and to suppress the use of GCC’s support libraries with one or more of the options -nostdlib -nostartfiles -nodefaultlibs...
  • Page 282 Chapter 9. Binary Compatibility...
  • Page 283: Gcov --A Test Coverage Program

    Chapter 10. --a Test Coverage Program gcov is a tool you can use in conjunction with GCC to test code coverage in your programs. gcov 10.1. Introduction to gcov is a test coverage program. Use it in concert with GCC to analyze your programs to help create gcov more efficient, faster running code and to discover untested parts of your program.
  • Page 284 gcov Chapter 10. --a Test Coverage Program -help Display help about using (on the standard output), and exit without doing any further gcov processing. -version Display the version number (on the standard output), and exit without doing any further gcov processing.
  • Page 285 gcov Chapter 10. --a Test Coverage Program directory|file -object-directory directory -object-file file Specify either the directory containing the gcov data files, or the object path name. The .gcno data files are searched for using this option. If a directory is specified, the data files are .gcda in that directory and named after the source file name, without its extension.
  • Page 286 gcov Chapter 10. --a Test Coverage Program 0:Graph:tmp.gcno 0:Data:tmp.gcda 0:Runs:1 0:Programs:1 1:#include stdio.h 3:int main (void) function main called 1 returned 1 blocks executed 75% int i, total; total = 0; for (i = 0; i 10; i++) total += i; if (total != 45) #####: printf ("Failure\n");...
  • Page 287 gcov Chapter 10. --a Test Coverage Program contain code, unless previous blocks end on those lines. The total execution count of a line is shown and subsequent lines show the execution counts for individual blocks that end on that line. After each block, the branch and call counts of the block will be shown, if the option is given.
  • Page 288: Gcov With Gcc Optimization

    gcov Chapter 10. --a Test Coverage Program For a branch, if it was executed at least once, then a percentage indicating the number of times the branch was taken divided by the number of times the branch was executed will be printed. Otherwise, the message "never executed"...
  • Page 289: Gcov Data Files

    gcov Chapter 10. --a Test Coverage Program calls to that function, and remove or ignore the other. Unfortunately, it will not remove the coverage counters for the unused function body. Hence when instrumented, all but one use of that function will show zero counts.
  • Page 290 gcov Chapter 10. --a Test Coverage Program...
  • Page 291: Known Causes Of Trouble With Gcc

    Chapter 11. Known Causes of Trouble with GCC This section describes known problems that affect users of GCC. Most of these are not GCC bugs per se--if they were, we would fix them. But the result for a user may be like the result of a bug. Some of these problems are due to bugs in other software, some are missing features that are too much work to add, and some are places where people’s opinions differ as to what is best.
  • Page 292 Chapter 11. Known Causes of Trouble with GCC An area where the difference is most apparent is name mangling. The use of different name man- gling is intentional, to protect you from more subtle problems. Compilers differ as to many internal details of C++ implementation, including: how class instances are laid out, how multiple inheri- tance is implemented, and how virtual function calls are handled.
  • Page 293: Problems Compiling Certain Programs

    Chapter 11. Known Causes of Trouble with GCC In extremely rare cases involving some very large functions you may receive errors from the HP • linker complaining about an out of bounds unconditional branch offset. This used to occur more often in previous versions of GCC, but is now exceptionally rare.
  • Page 294: Incompatibilities Of Gcc

    Chapter 11. Known Causes of Trouble with GCC 11.4. Problems Compiling Certain Programs Certain programs have problems compiling. Parse errors may occur compiling X11 on a Decstation running Ultrix 4.2 because of problems • in DEC’s versions of the X11 header files .
  • Page 295 Chapter 11. Known Causes of Trouble with GCC When you use , the only automatic variables guaranteed to remain valid are • setjmp longjmp those declared . This is a consequence of automatic register allocation. Consider this volatile function: jmp_buf j; foo () int a, b;...
  • Page 296 Chapter 11. Known Causes of Trouble with GCC GCC complains about unterminated character constants inside of preprocessing conditionals that • fail. Some programs have English comments enclosed in conditionals that are guaranteed to fail; if these comments contain apostrophes, GCC will probably report an error. For example, this code would produce an error: #if 0 You can’t expect this to work.
  • Page 297: Fixed Header Files

    Chapter 11. Known Causes of Trouble with GCC 11.6. Fixed Header Files GCC needs to install corrected versions of some system header files. This is because most target systems have some header files that won’t work with GCC unless they are changed. Some have bugs, some are incompatible with ISO C, and some depend on special features of other compilers.
  • Page 298 Chapter 11. Known Causes of Trouble with GCC that would be desirable anyway. So GCC simply does not mention the eliminated variable when it writes debugging information. You have to expect a certain amount of disagreement between the executable and your source code, when you use optimization.
  • Page 299: Common Misunderstandings With Gnu C

    Chapter 11. Known Causes of Trouble with GCC 11.9. Common Misunderstandings with GNU C++ C++ is a complex language and an evolving one, and its standard definition (the ISO C++ standard) was only recently completed. As a result, your C++ compiler may occasionally surprise you, even when its behavior is correct.
  • Page 300 Chapter 11. Known Causes of Trouble with GCC Here, the names appear in a context that does not depend on the type of . The compiler will thus require that they are defined in the context of use in the template, not only before the point of instantiation, and will here use , respectively.
  • Page 301: Temporaries May Vanish Before You Expect

    Chapter 11. Known Causes of Trouble with GCC x.cc:6: error: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) To make the code valid either use , or . Using the flag this- f() Base T ::f()
  • Page 302: Implicit Copy-Assignment For Virtual Bases

    Chapter 11. Known Causes of Trouble with GCC 11.9.4. Implicit Copy-Assignment for Virtual Bases When a base class is virtual, only one subobject of the base class belongs to each full object. Also, the constructors and destructors are invoked only once, and called from the most-derived class. However, such objects behave unspecified when being assigned.
  • Page 303: Certain Changes We Don't Want To Make

    Chapter 11. Known Causes of Trouble with GCC There are some C constructs which cannot figure out. For example, it can’t determine • protoize argument types for declaring a pointer-to-function variable; this you must do by hand. protoize inserts a comment containing each time it finds such a variable;...
  • Page 304 Chapter 11. Known Causes of Trouble with GCC Shift count operands are probably signed more often than unsigned. Warning about this would cause far more annoyance than good. Warning about assigning a signed value to an unsigned variable. • Such assignments must be very common; warning about them would cause more annoyance than good.
  • Page 305 Chapter 11. Known Causes of Trouble with GCC (Of course, users strongly concerned about portability should indicate explicitly in each bit-field whether it is signed or not. In this way, they write programs which have the same meaning in both C dialects.) Undefining when...
  • Page 306: Warning Messages And Error Messages

    Chapter 11. Known Causes of Trouble with GCC There is no guarantee (in either the C or the C++ standard language definitions) that the increments will be evaluated in any particular order. Either increment might happen first. might get the func arguments , or it might get...
  • Page 307: Funding Free Software

    Chapter 12. Funding Free Software If you want to have more free software a few years from now, it makes sense for you to help encourage people to contribute funds for its development. The most effective approach known is to encourage commercial redistributors to donate.
  • Page 308 Chapter 12. Funding Free Software...
  • Page 309: Option Index

    Option Index D, see Section 4.11 Options Controlling the Prepro- GCC’s command line options are indexed here cessor without any initial . Where an option d, see Section 4.9 Options for Debugging Your Pro- has both positive and negative forms (such as gram or GCC ), relevant entries in -fno-...
  • Page 310 Option Index dM, see Section 4.9 Options for Debugging Your Pro- gram or GCC E, see Section 4.13 Options for Linking dN, see Section 4.11 Options Controlling the Prepro- E, see Section 4.2 Options Controlling the Kind of cessor Output dN, see Section 4.9 Options for Debugging Your Pro- exported_symbols_list, see Section 4.17.2 Darwin gram or GCC...
  • Page 311 Option Index fdata-sections, see Section 4.10 Options That Control fgcse, see Section 4.10 Options That Control Opti- Optimization mization fgcse-las, see Section 4.10 Options That Control Op- fdelayed-branch, see Section 4.10 Options That Con- timization trol Optimization fgcse-lm, see Section 4.10 Options That Control Op- fdelete-null-pointer-checks, see Section 4.10 Options timization That Control Optimization...
  • Page 312 Option Index fno-builtin, see Section 6.45 Other built-in functions fno-peephole, see Section 4.10 Options That Control provided by GCC Optimization fno-builtin, see Section 4.4 Options Controlling C Di- fno-peephole2, see Section 4.10 Options That Control alect Optimization fno-common, see Section 6.32 Specifying Attributes fno-rtti, see Section 4.5 Options Controlling C++ Di- of Variables alect...
  • Page 313 Option Index fpermissive, see Section 4.5 Options Controlling C++ fsched-stalled-insns-dep, see Section 4.10 Options Dialect That Control Optimization fsched-verbose, see Section 4.9 Options for Debug- fPIC, see Section 4.18 Options for Code Generation ging Your Program or GCC Conventions fsched2-use-superblocks, see Section 4.10 Options fpic, see Section 4.18 Options for Code Generation That Control Optimization Conventions...
  • Page 314 Option Index ftime-report, see Section 4.9 Options for Debugging g, see Section 4.9 Options for Debugging Your Pro- Your Program or GCC gram or GCC gcoff, see Section 4.9 Options for Debugging Your ftracer, see Section 4.10 Options That Control Opti- Program or GCC mization gdwarf-2, see Section 4.9 Options for Debugging Your...
  • Page 315 Option Index isystem, see Section 4.11 Options Controlling the Pre- maix64, see Section 4.17.1 IBM RS/6000 and Pow- processor erPC Options iwithprefix, see Section 4.11 Options Controlling the malign-double, see Section 4.17.3 Intel 386 and AMD Preprocessor x86-64 Options iwithprefixbefore, see Section 4.11 Options Control- malign-natural, see Section 4.17.1 IBM RS/6000 and ling the Preprocessor PowerPC Options...
  • Page 316 Option Index mdwarf2-asm, see Section 4.17.4 IA-64 Options MMD, see Section 4.11 Options Controlling the Pre- processor mdynamic-no-pic, see Section 4.17.1 IBM RS/6000 and PowerPC Options mminimal-toc, see Section 4.17.1 IBM RS/6000 and PowerPC Options meabi, see Section 4.17.1 IBM RS/6000 and PowerPC Options mmmx, see Section 4.17.3 Intel 386 and AMD x86-64 Options...
  • Page 317 Option Index mno-power2, see Section 4.17.1 IBM RS/6000 and mpower, see Section 4.17.1 IBM RS/6000 and Pow- PowerPC Options erPC Options mno-powerpc, see Section 4.17.1 IBM RS/6000 and mpower2, see Section 4.17.1 IBM RS/6000 and Pow- PowerPC Options erPC Options mno-powerpc-gfxopt, see Section 4.17.1 IBM mpowerpc, see Section 4.17.1 IBM RS/6000 and Pow- RS/6000 and PowerPC Options...
  • Page 318 Option Index msoft-float, see Section 4.17.3 Intel 386 and AMD x86-64 Options no-integrated-cpp, see Section 4.4 Options Control- msoft-float, see Section 4.17.1 IBM RS/6000 and Pow- ling C Dialect erPC Options no-red-zone, see Section 4.17.3 Intel 386 and AMD mspe, see Section 4.17.1 IBM RS/6000 and PowerPC x86-64 Options Options noall_load, see Section 4.17.2 Darwin Options...
  • Page 319 Option Index pedantic, see Chapter 6 Extensions to the C Language Family read_only_relocs, see Section 4.17.2 Darwin Options pedantic, see Section 4.11 Options Controlling the remap, see Section 4.11 Options Controlling the Pre- Preprocessor processor pedantic, see Section 4.8 Options to Request or Sup- press Warnings pedantic, see Chapter 3 Language Standards Sup- ported by GCC...
  • Page 320 Option Index w, see Section 4.8 Options to Request or Suppress Warnings target-help, see Section 4.11 Options Controlling the Wa, see Section 4.12 Passing Options to the Assem- Preprocessor bler target-help, see Section 4.2 Options Controlling the Wabi, see Section 4.5 Options Controlling C++ Di- Kind of Output alect time, see Section 4.9 Options for Debugging Your...
  • Page 321 Option Index Wfloat-equal, see Section 4.8 Options to Request or Wno-deprecated, see Section 4.5 Options Controlling Suppress Warnings C++ Dialect Wformat, see Section 6.25 Declaring Attributes of Wno-deprecated-declarations, see Section 4.8 Op- Functions tions to Request or Suppress Warnings Wformat, see Section 4.8 Options to Request or Sup- Wno-div-by-zero, see Section 4.8 Options to Request press Warnings or Suppress Warnings...
  • Page 322 Option Index Wselector, see Section 4.6 Options Controlling Wunused-value, see Section 4.8 Options to Request or Objective-C Dialect Suppress Warnings Wsequence-point, see Section 4.8 Options to Request Wunused-variable, see Section 4.8 Options to Request or Suppress Warnings or Suppress Warnings Wwrite-strings, see Section 4.8 Options to Request or Wshadow, see Section 4.8 Options to Request or Sup- Suppress Warnings...
  • Page 323: Keyword Index

    Keyword Index extensions, see Section 6.8 Conditionals with Omitted Operands extensions, see Section 6.7 Generalized Lvalues ?: side effect, see Section 6.8 Conditionals with Omit- in constraint, see Section 6.36.2 Multiple Alterna- ted Operands tive Constraints in variables in macros, see Section 6.6 Referring to in constraint, see Section 6.36.3 Constraint Modifier a Type with typeof...
  • Page 324 Keyword Index __builtin_ctz, see Section 6.45 Other built-in func- __builtin_parityl, see Section 6.45 Other built-in func- tions provided by GCC tions provided by GCC __builtin_ctzl, see Section 6.45 Other built-in func- __builtin_parityll, see Section 6.45 Other built-in tions provided by GCC functions provided by GCC __builtin_ctzll, see Section 6.45 Other built-in func- __builtin_popcount, see Section 6.45 Other built-in...
  • Page 325 Keyword Index acos, see Section 6.45 Other built-in functions pro- ARM [Annotated C++ Reference Manual], see Sec- vided by GCC tion 7.13 Backwards Compatibility arrays of length zero, see Section 6.12 Arrays of acosf, see Section 6.45 Other built-in functions pro- Length Zero vided by GCC arrays of variable length, see Section 6.14 Arrays of...
  • Page 326 Keyword Index C++ source file suffixes, see Section 4.3 Compiling C++ Programs Backwards Compatibility, see Section 7.13 Back- C++ static data, declaring and defining, see Section wards Compatibility 11.9.1 Declare andDefine Static Members base class members, see Section 11.9.2 Name lookup, C89, see Chapter 3 Language Standards Supported by templates, and accessing members of base classes bcmp, see Section 6.45 Other built-in functions pro-...
  • Page 327 Keyword Index casinhl, see Section 6.45 Other built-in functions pro- COBOL, see Chapter 2 Programming Languages vided by GCC Supported by GCC casinl, see Section 6.45 Other built-in functions pro- code generation conventions, see Section 4.18 Op- vided by GCC tions for Code Generation Conventions cast to a union, see Section 6.23 Cast to a Union Type code, mixed with declarations, see Section 6.24 Mixed...
  • Page 328 Keyword Index constraints, , see Section 6.36 Constraints for csinhl, see Section 6.45 Other built-in functions pro- Operands vided by GCC constraints, machine specific, see Section 6.36.4 Con- csinl, see Section 6.45 Other built-in functions pro- straints for Particular Machines vided by GCC constructing calls, see Section 6.5 Constructing Func- csqrt, see Section 6.45 Other built-in functions pro-...
  • Page 329 Keyword Index attribute., see Section 6.25 Declaring error messages, see Section 11.12 Warning Messages deprecated Attributes of Functions and Error Messages escaped newlines, see Section 6.16 Slightly Looser designated initializers, see Section 6.21 Designated Rules for Escaped Newlines Initializers exclamation point, see Section 6.36.2 Multiple Alter- designator lists, see Section 6.21 Designated Initializ- native Constraints exit, see Section 6.45 Other built-in functions pro-...
  • Page 330 Keyword Index fmodl, see Section 6.45 Other built-in functions pro- vided by GCC fabs, see Section 6.45 Other built-in functions pro- function attribute, see Section 6.25 Declaring format vided by GCC Attributes of Functions fabsf, see Section 6.45 Other built-in functions pro- function attribute, see Section 6.25 format_arg vided by GCC...
  • Page 331 Keyword Index functions that do not pop the argument stack on the GNAT, see Chapter 2 Programming Languages Sup- 386, see Section 6.25 Declaring Attributes of Func- ported by GCC tions GNU C Compiler, see Chapter 2 Programming Lan- guages Supported by GCC functions that do pop the argument stack on the 386, GNU Compiler Collection, see Chapter 2 Program- see Section 6.25 Declaring Attributes of Functions...
  • Page 332 Keyword Index implied , see Section ISO C9X, see Chapter 3 Language Standards Sup- #pragma implementation 7.5 #pragma interface and implementation ported by GCC incompatibilities of GCC, see Section 11.5 Incompat- ISO support, see Section 4.4 Options Controlling C ibilities of GCC Dialect index, see Section 6.45 Other built-in functions pro- ISO/IEC 9899, see Chapter 3 Language Standards...
  • Page 333 Keyword Index LC_MESSAGES, see Section 4.19 Environment Vari- log1p, see Section 6.45 Other built-in functions pro- ables Affecting GCC vided by GCC ldexp, see Section 6.45 Other built-in functions pro- log1pf, see Section 6.45 Other built-in functions pro- vided by GCC vided by GCC ldexpf, see Section 6.45 Other built-in functions pro- log1pl, see Section 6.45 Other built-in functions pro-...
  • Page 334 Keyword Index macros containing , see Section 6.35 Assembler modff, see Section 6.45 Other built-in functions pro- Instructions with C Expression Operands vided by GCC macros, inline alternative, see Section 6.34 An Inline modfl, see Section 6.45 Other built-in functions pro- Function is As Fast As a Macro vided by GCC macros, local labels, see Section 6.2 Locally Declared...
  • Page 335 Keyword Index function attribute, see Section 6.25 other register constraints, see Section 6.36.1 Simple noreturn Declaring Attributes of Functions Constraints function attribute, see Section 6.25 Declar- output file option, see Section 4.2 Options Controlling nothrow ing Attributes of Functions the Kind of Output in constraint, see Section 6.36.1 Simple Constraints overloaded virtual fn, warning, see Section 4.5 Op- tions Controlling C++ Dialect...
  • Page 336 Keyword Index pragmas, warning of unknown, see Section 4.8 Op- remainder, see Section 6.45 Other built-in functions tions to Request or Suppress Warnings provided by GCC precompiled headers, see Section 4.20 Using Precom- remainderf, see Section 6.45 Other built-in functions piled Headers provided by GCC preprocessing numbers, see Section 11.5 Incompati-...
  • Page 337 Keyword Index scalbln, see Section 6.45 Other built-in functions pro- sincosl, see Section 6.45 Other built-in functions pro- vided by GCC vided by GCC scalblnf, see Section 6.45 Other built-in functions pro- sinf, see Section 6.45 Other built-in functions pro- vided by GCC vided by GCC scalbn, see Section 6.45 Other built-in functions pro-...
  • Page 338 Keyword Index strcmp, see Section 6.45 Other built-in functions pro- vided by GCC tan, see Section 6.45 Other built-in functions provided strcpy, see Section 6.45 Other built-in functions pro- by GCC vided by GCC tanf, see Section 6.45 Other built-in functions pro- strcspn, see Section 6.45 Other built-in functions pro- vided by GCC vided by GCC...
  • Page 339 Keyword Index truncf, see Section 6.45 Other built-in functions pro- variable number of arguments, see Section 6.15 vided by GCC Macros with a Variable Number of Arguments. truncl, see Section 6.45 Other built-in functions pro- variable-length array scope, see Section 6.14 Arrays vided by GCC of Variable Length two-stage name lookup, see Section 11.9.2 Name...
  • Page 340 Keyword Index warning for synthesized methods, see Section 4.5 Op- tions Controlling C++ Dialect warning for unknown pragmas, see Section 4.8 Op- tions to Request or Suppress Warnings warning messages, see Section 4.8 Options to Request or Suppress Warnings warnings from system headers, see Section 4.8 Op- tions to Request or Suppress Warnings warnings vs errors, see Section 11.12 Warning Mes- sages and Error Messages...

Table of Contents