GCC(1) GNU GCC(1) NAME top gcc - GNU project C and C++ compiler SYNOPSIS top gcc [-c|. This manual documents only one of these two forms.
Gcc Manual 4.7.2
Gcc(1) - Linux man page Name. gcc - GNU project C and C++ compiler. This manual documents only one of these two forms, whichever one is not the default. Options.
The GNU C Reference Manual
Preface. This is a reference manual for the C programming language as implemented by the GNU Compiler Collection (GCC). Specifically, this manual aims to document.
An Introduction to GCC for the GNU Compilers gcc and g++ Brian Gough Foreword by Richard M. Stallman.
Gazillion Bubble Typhoon Manual Transmission
2. Overview of the whole thing. We are here to learn about GCC inline assembly. What this inline stands for? We can instruct the compiler to insert the code of a.
The 1989 ANSI C standard, commonly known as “C89” The 1999 ISO C standard, commonly known as “C99”, to the extent that C99 is implemented by GCC The current state of GNU extensions to standard C This manual describes C89 as its baseline. C99 features and GNU extensions are explicitly labeled as such. By default, GCC will compile code as C89 plus GNU-specific extensions. Much of C99 is supported; once full support is available, the default compilation dialect will be C99 plus GNU-specific extensions. (Some of the GNU extensions to C89 ended up, sometimes slightly modified, as standard language features in C99.) The C language includes a set of preprocessor directives, which are used for things such as macro text replacement, conditional compilation, and file inclusion. Although normally described in a C language manual, the GNU C preprocessor has been thoroughly documented in The C Preprocessor , a separate manual which covers preprocessing for C, C++, and Objective-C programs, so it is not included here. Credits Thanks to everyone who has helped with editing, proofreading, ideas, typesetting, and administrivia, including: Diego Andres Alvarez Marin, Nelson H. F. Beebe, Karl Berry, Robert Chassell, Hanfeng Chen, Antonio Diaz Diaz, Andreas Foerster, Denver Gingerich, Lisa Goldstein, Robert Hansen, Jean-Christophe Helary, Mogens Hetsholm, Teddy Hogeborn, Joe Humphries, J. Wren Hunt, Adam Johansen, Vladimir Kadlec, Benjamin Kagia, Dright Kayorent, Sugun Kedambadi, Felix Lee, Bjorn Liencres, Steve Morningthunder, Aljosha Papsch, Matthew Plant, Richard Stallman, J. Otto Tennant, Ole Tetlie, Keith Thompson, T.F. Torrey, James Youngman, and Steve Zachar. Trevis Rothwell serves as project maintainer and, along with James Youngman, wrote the bulk of the text. Some example programs are based on algorithms in Donald Knuth's The Art of Computer Programming . Please send bug reports and suggestions to [email protected]. 1.1 Identifiers Identifiers are sequences of characters used for naming variables, functions, new data types, and preprocessor macros. You can include letters, decimal digits, and the underscore character ‘_’ in identifiers. The first character of an identifier cannot be a digit. Lowercase letters and uppercase letters are distinct, such that foo and FOO are two different identifiers. When using GNU extensions, you can also include the dollar sign character ‘$’ in identifiers. For example, 45U is an unsigned int constant. You can also combine letters: 45UL is an unsigned long int constant. (The letters may be used in any order.) Both ISO C99 and GNU C extensions add the integer types long long int and unsigned long long int. You can use two ‘L’s to get a long long int constant; add a ‘U’ to that and you have an unsigned long long int constant. For example: 45ULL. 1.3.2 Character Constants A character constant is usually a single character enclosed within single quotation marks, such as 'Q'. A character constant is of type int by default. Some characters, such as the single quotation mark character itself, cannot be represented using only one character. To represent such characters, there are several “escape sequences” that you can use: To use any of these escape sequences, enclose the sequence in single quotes, and treat it as if it were any other character. For example, the letter m is 'm' and the newline character is '\ '. The octal number escape sequence is the backslash character followed by one, two, or three octal digits (0 to 7). For example, 101 is the octal equivalent of 65, which is the ASCII character 'A'. Thus, the character constant '\\101' is the same as the character constant 'A'. The hexadecimal escape sequence is the backslash character, followed by x and an unlimited number of hexadecimal digits (0 to 9, and a to f or A to F). While the length of possible hexadecimal digit strings is unlimited, the number of character constants in any given character set is not. (The much-used extended ASCII character set, for example, has only 256 characters in it.) If you try to use a hexadecimal value that is outside the range of characters, you will get a compile-time error. signed char The 8-bit signed char data type can hold integer values in the range of −128 to 127. unsigned char The 8-bit unsigned char data type can hold integer values in the range of 0 to 255. char Depending on your system, the char data type is defined as having the same range as either the signed char or the unsigned char data type (they are three distinct types, however). By convention, you should use the char data type specifically for storing ASCII characters (such as `m'), including escape sequences (such as `\ '). short int The 16-bit short int data type can hold integer values in the range of −32,768 to 32,767. You may also refer to this data type as short, signed short int, or signed short. unsigned short int The 16-bit unsigned short int data type can hold integer values in the range of 0 to 65,535. You may also refer to this data type as unsigned short. int The 32-bit int data type can hold integer values in the range of −2,147,483,648 to 2,147,483,647. You may also refer to this data type as signed int or signed. unsigned int The 32-bit unsigned int data type can hold integer values in the range of 0 to 4,294,967,295. You may also refer to this data type simply as unsigned. long int The 32-bit long int data type can hold integer values in the range of at least −2,147,483,648 to 2,147,483,647. (Depending on your system, this data type might be 64-bit, in which case its range is identical to that of the long long int data type.) You may also refer to this data type as long, signed long int, or signed long. unsigned long int The 32-bit unsigned long int data type can hold integer values in the range of at least 0 to 4,294,967,295. (Depending on your system, this data type might be 64-bit, in which case its range is identical to that of the unsigned long long int data type.) You may also refer to this data type as unsigned long. long long int The 64-bit long long int data type can hold integer values in the range of −9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. You may also refer to this data type as long long, signed long long int or signed long long. This type is not part of C89, but is both part of C99 and a GNU C extension. unsigned long long int The 64-bit unsigned long long int data type can hold integer values in the range of at least 0 to 18,446,744,073,709,551,615. You may also refer to this data type as unsigned long long. This type is not part of C89, but is both part of C99 and a GNU C extension. The first line declares a float named foo but does not define its value; it is left uninitialized, and its value should not be assumed to be anything in particular. The real number types provided in C are of finite precision, and accordingly, not all real numbers can be represented exactly. Most computer systems that GCC compiles for use a binary representation for real numbers, which is unable to precisely represent numbers such as, for example, 4.2. For this reason, we recommend that you consider not comparing real numbers for exact equality with the == operator, but rather check that real numbers are within an acceptable tolerance. There are other more subtle implications of these imprecise representations; for more details, see David Goldberg's paper What Every Computer Scientist Should Know About Floating-Point Arithmetic and section 4.2.2 of Donald Knuth's The Art of Computer Programming . 2.1.3.2 GNU Extensions for Complex Number Types GCC also introduced complex types as a GNU extension to C89, but the spelling is different. The floating-point complex types in GCC's C89 extension are: 2.4.5 Size of Structures The size of a structure type is equal to the sum of the size of all of its members, possibly including padding to cause the structure type to align to a particular byte boundary. The details vary depending on your computer platform, but it would not be atypical to see structures padded to align on four- or eight-byte boundaries. This is done in order to speed up memory accesses of instances of the structure type. As a GNU extension, GCC allows structures with no members. Such structures have zero size. If you wish to explicitly omit padding from your structure types (which may, in turn, decrease the speed of structure memory accesses), then GCC provides multiple methods of turning packing off. The quick and easy method is to use the -fpack-struct compiler option. For more details on omitting packing, please see the GCC manual which corresponds to your version of the compiler. For standard C code, the number of elements in an array must be positive. As a GNU extension, the number of elements can be as small as zero. Zero-length arrays are useful as the last element of a structure which is really a header for a variable-length object: However, there are functions in the GNU C library that perform operations (including copy) on string arrays. You can also change one character at a time, by accessing individual string elements as you would any other array: 3.2 Assignment Operators Assignment operators store values in variables. C provides several variations of assignment operators. The standard assignment operator = simply stores the value of its right operand in the variable specified by its left operand. As with all assignment operators, the left operand (commonly referred to as the “lvalue”) cannot be a literal or constant value. 3.7 Logical Operators Logical operators test the truth value of a pair of operands. Any nonzero expression is considered true in C, while an expression that evaluates to zero is considered false. The logical conjunction operator && tests if two expressions are both true. If the first expression is false, then the second expression is not evaluated. 3.18 Statements and Declarations in Expressions As a GNU C extension, you can build an expression using compound statement enclosed in parentheses. This allows you to included loops, switches, and local variables within an expression. Recall that a compound statement (also known as a block) is a sequence of statements surrounded by braces. In this construct, parentheses go around the braces. Here is an example: That is a valid (though slightly more complex than necessary) expression for the absolute value of function (). The last thing in the compound statement should be an expression followed by a semicolon; the value of this subexpression serves as the value of the entire construct. (If you use some other kind of statement last within the braces, the construct has type void, and thus effectively no value.) This feature is especially useful in making macro definitions “safe” (so that they evaluate each operand exactly once). For example, the “maximum” function is commonly defined as a macro in standard C as follows: 3.19 Operator Precedence When an expression contains multiple operators, such as a + b * f(), the operators are grouped based on rules of precedence. For instance, the meaning of that expression is to call the function f with no arguments, multiply the result by b, then add that result to a. That's what the C rules of operator precedence determine for this expression. The following is a list of types of expressions, presented in order of highest precedence first. Sometimes two or more operators have equal precedence; all those operators are applied from left to right unless stated otherwise. 3.20 Order of Evaluation In C you cannot assume that multiple subexpressions are evaluated in the order that seems natural. For instance, consider the expression ++a * f(). Does this increment a before or after calling the function f? The compiler could do it in either order, so you cannot make assumptions. This manual explains the semantics of the C language in the abstract. However, an actual compiler translates source code into specific actions in an actual computer, and may re-order operations for the sake of efficiency. The correspondence between the program you write and the things the computer actually does are specified in terms of side effects and sequence points. So, we see that our program is standard-conforming. Notice that the above argument does not actually depend on the details of the body of the function f. It only depends on the function containing something ending in a sequence point – in our example this is a return statement, but an expression statement or a full declarator would do just as well. However, the result of executing this code depends on the order of evaluation of the operands of *. If the left-hand operand is evaluated first, foo returns 6. Otherwise, it returns 303. The C standard does not specify in which order the operands should be evaluated, and also does not require an implementation either to document the order or even to stick to one order. The effect of this code is unspecified, meaning that one of several specific things will happen, but the C standards do not say which. 3.20.4 Sequence Points and Signal Delivery Signals are mainly documented in the GNU C Library manual rather than this document, even though the C standards consider the compiler and the C library together to be “the implementation ”. When a signal is received, this will happen between sequence points. Side effects on volatile objects prior to the previous sequence point will have occurred, but other updates may not have occurred yet. This even applies to straight assignments, such as x=0;, because the code generated for that statement may require more than one instruction, meaning that it can be interrupted part-way through by the delivery of a signal. The C standard is quite restrictive about what data access can occur within a signal handler. They can of course use auto variables, but in terms of reading or writing other objects, they must be volatile sig_atomic_t. The volatile type qualifier ensures that access to the variable in the other parts of the program doesn't span sequence points and the use of the sig_atomic_t type ensures that changes to the variable are atomic with respect to signal delivery. The POSIX standard also allows a small number of library functions to be called from a signal handler. These functions are referred to as the set of async-signal-safe functions. If your program is intended to run on a POSIX system but not on other systems, you can safely call these from your signal handler too. The ISO C standard mandates that a label must be followed by at least one statement, possibly a null statement (see The Null Statement). GCC will compile code that does not meet this requirement, but be aware that if you violate it, your code may have portability issues. This is often not desired. Including a break statement at the end of each case redirects program flow to after the switch statement. As a GNU C extension, you can also specify a range of consecutive integer values in a single case label, like this: To work with the optional parameters in the function definition, you need to use macros that are defined in the library header file ‘<stdarg.h>’, so you must #include that file. For a detailed description of these macros, see The GNU C Library manual's section on variadic functions. Here is an example: 7 A Sample Program To conclude our description of C, here is a complete program written in C, consisting of both a C source file and a header file. This program is an expanded version of the quintessential “hello world” program, and serves as an example of how to format and structure C code for use in programs for FSF Project GNU. (You can always download the most recent version of this program, including sample makefiles and other examples of how to produce GNU software, from http://www.gnu.org/software/hello.) This program uses features of the preprocessor; for a description of preprocessor macros, see The C Preprocessor , available as part of the GCC documentation. A.2 Examples of Code Assuming Wraparound Overflow There has long been a tension between what the C standard requires for signed integer overflow, and what C programs commonly assume. The standard allows aggressive optimizations based on assumptions that overflow never occurs, but many practical C programs rely on overflow wrapping around. These programs do not conform to the standard, but they commonly work in practice because compiler writers are understandably reluctant to implement optimizations that would break many programs, unless perhaps a user specifies aggressive optimization. The C Standard says that if a program has signed integer overflow its behavior is undefined, and the undefined behavior can even precede the overflow. To take an extreme example: The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference.
GCC stands for GNU Compiler Collection. GCC is highly flexible compiler system. It has different compiler front-ends for different languages. It has many back-ends.
The compiler in WinAVR is the GNU Compiler Collection. FAQ in the avr-libc documentation included in the WinAVR package or the avr-libc user manual online.
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 the.