From 1378ea41ccecbea1d5148234c9b6bac3c6147143 Mon Sep 17 00:00:00 2001 From: Simon Schubert Date: Sat, 13 Jan 2007 16:32:16 +0000 Subject: [PATCH] Update to gcc-3.4.6 --- contrib/gcc-3.4/BUGS | 462 +- contrib/gcc-3.4/FAQ | 451 +- contrib/gcc-3.4/LAST_UPDATED | 2 +- contrib/gcc-3.4/README.DELETED | 1029 +- contrib/gcc-3.4/README.DRAGONFLY | 13 +- contrib/gcc-3.4/gcc/builtins.c | 37 +- contrib/gcc-3.4/gcc/c-common.c | 12 + contrib/gcc-3.4/gcc/c-common.h | 2 + contrib/gcc-3.4/gcc/c-decl.c | 49 +- contrib/gcc-3.4/gcc/c-objc-common.c | 15 +- contrib/gcc-3.4/gcc/c-typeck.c | 3 +- contrib/gcc-3.4/gcc/config/i386/i386.md | 16 +- contrib/gcc-3.4/gcc/coverage.c | 4 +- contrib/gcc-3.4/gcc/cp/call.c | 4 +- contrib/gcc-3.4/gcc/cp/class.c | 36 +- contrib/gcc-3.4/gcc/cp/cvt.c | 2 + contrib/gcc-3.4/gcc/cp/decl.c | 56 +- contrib/gcc-3.4/gcc/cp/decl2.c | 28 +- contrib/gcc-3.4/gcc/cp/error.c | 3 + contrib/gcc-3.4/gcc/cp/init.c | 11 +- contrib/gcc-3.4/gcc/cp/lex.c | 24 +- contrib/gcc-3.4/gcc/cp/method.c | 8 +- contrib/gcc-3.4/gcc/cp/name-lookup.c | 63 +- contrib/gcc-3.4/gcc/cp/name-lookup.h | 1 + contrib/gcc-3.4/gcc/cp/parser.c | 162 +- contrib/gcc-3.4/gcc/cp/pt.c | 56 +- contrib/gcc-3.4/gcc/cp/search.c | 8 +- contrib/gcc-3.4/gcc/cp/semantics.c | 36 +- contrib/gcc-3.4/gcc/cp/typeck.c | 18 +- contrib/gcc-3.4/gcc/cppfiles.c | 22 +- contrib/gcc-3.4/gcc/cpphash.h | 2 +- contrib/gcc-3.4/gcc/cppinit.c | 6 +- contrib/gcc-3.4/gcc/cse.c | 3 + contrib/gcc-3.4/gcc/doc/contrib.texi | 9 +- contrib/gcc-3.4/gcc/doc/cpp.1 | 918 ++ contrib/gcc-3.4/gcc/doc/g++.1 | 10726 ++++++++++++++++ contrib/gcc-3.4/gcc/doc/g77.1 | 1735 +++ contrib/gcc-3.4/gcc/doc/gcc.1 | 10726 ++++++++++++++++ contrib/gcc-3.4/gcc/doc/gcov.1 | 607 + .../gcc-3.4/gcc/doc/include/gcc-common.texi | 4 +- contrib/gcc-3.4/gcc/doc/invoke.texi | 10 +- contrib/gcc-3.4/gcc/expmed.c | 35 +- contrib/gcc-3.4/gcc/f/g77.texi | 9 +- contrib/gcc-3.4/gcc/f/g77spec.c | 4 +- contrib/gcc-3.4/gcc/flow.c | 18 +- contrib/gcc-3.4/gcc/fold-const.c | 26 +- contrib/gcc-3.4/gcc/gcc.c | 4 +- contrib/gcc-3.4/gcc/gcov-dump.c | 4 +- contrib/gcc-3.4/gcc/gcov.c | 6 +- contrib/gcc-3.4/gcc/global.c | 9 +- contrib/gcc-3.4/gcc/local-alloc.c | 13 +- contrib/gcc-3.4/gcc/longlong.h | 13 +- contrib/gcc-3.4/gcc/mips-tdump.c | 4 +- contrib/gcc-3.4/gcc/mips-tfile.c | 4 +- contrib/gcc-3.4/gcc/optabs.c | 17 +- contrib/gcc-3.4/gcc/pretty-print.c | 2 +- contrib/gcc-3.4/gcc/reg-stack.c | 2 +- contrib/gcc-3.4/gcc/regrename.c | 6 +- contrib/gcc-3.4/gcc/regs.h | 7 + contrib/gcc-3.4/gcc/rtl.h | 1 + contrib/gcc-3.4/gcc/sched-rgn.c | 36 + contrib/gcc-3.4/gcc/simplify-rtx.c | 10 +- contrib/gcc-3.4/gcc/toplev.c | 6 +- contrib/gcc-3.4/gcc/tree.c | 53 +- contrib/gcc-3.4/gcc/version.c | 2 +- contrib/gcc-3.4/include/ansidecl.h | 9 + contrib/gcc-3.4/include/md5.h | 8 +- contrib/gcc-3.4/libf2c/ChangeLog | 8 + contrib/gcc-3.4/libiberty/ChangeLog | 24 + contrib/gcc-3.4/libiberty/md5.c | 17 + contrib/gcc-3.4/libobjc/ChangeLog | 14 + contrib/gcc-3.4/libobjc/README | 25 +- contrib/gcc-3.4/libstdc++-v3/ChangeLog | 37 + .../libstdc++-v3/include/bits/c++config | 2 +- .../libstdc++-v3/include/c_std/std_cmath.h | 66 +- .../libstdc++-v3/include/ext/hashtable.h | 4 +- 76 files changed, 26448 insertions(+), 1436 deletions(-) create mode 100644 contrib/gcc-3.4/gcc/doc/cpp.1 create mode 100644 contrib/gcc-3.4/gcc/doc/g++.1 create mode 100644 contrib/gcc-3.4/gcc/doc/g77.1 create mode 100644 contrib/gcc-3.4/gcc/doc/gcc.1 create mode 100644 contrib/gcc-3.4/gcc/doc/gcov.1 diff --git a/contrib/gcc-3.4/BUGS b/contrib/gcc-3.4/BUGS index 37252d8077..92377cba50 100644 --- a/contrib/gcc-3.4/BUGS +++ b/contrib/gcc-3.4/BUGS @@ -1,7 +1,7 @@ GCC Bugs - The latest version of this document is always available at + The latest version of this document is always available at [1]http://gcc.gnu.org/bugs.html. _________________________________________________________________ @@ -13,7 +13,7 @@ Table of Contents + [5]Where to post it + [6]Detailed bug reporting instructions + [7]Detailed bug reporting instructions for GNAT - + [8]Detailed bug reporting instructions when using a + + [8]Detailed bug reporting instructions when using a precompiled header * [9]Frequently Reported Bugs in GCC + [10]C++ @@ -29,37 +29,37 @@ Table of Contents Reporting Bugs - The main purpose of a bug report is to enable us to fix the bug. The - most important prerequisite for this is that the report must be + The main purpose of a bug report is to enable us to fix the bug. The + most important prerequisite for this is that the report must be complete and self-contained. - Before you report a bug, please check the [19]list of well-known bugs - and, if possible, try a current development snapshot. If you want to - report a bug with versions of GCC before 3.4 we strongly recommend + Before you report a bug, please check the [19]list of well-known bugs + and, if possible, try a current development snapshot. If you want to + report a bug with versions of GCC before 3.4 we strongly recommend upgrading to the current release first. - Before reporting that GCC compiles your code incorrectly, please - compile it with gcc -Wall and see whether this shows anything wrong + Before reporting that GCC compiles your code incorrectly, please + compile it with gcc -Wall and see whether this shows anything wrong with your code that could be the cause instead of a bug in GCC. Summarized bug reporting instructions - After this summary, you'll find detailed bug reporting instructions, - that explain how to obtain some of the information requested in this + After this summary, you'll find detailed bug reporting instructions, + that explain how to obtain some of the information requested in this summary. What we need - Please include in your bug report all of the following items, the + Please include in your bug report all of the following items, the first three of which can be obtained from the output of gcc -v: * the exact version of GCC; * the system type; * the options given when GCC was configured/built; * the complete command line that triggers the bug; * the compiler output (error messages, warnings, etc.); and - * the preprocessed file (*.i*) that triggers the bug, generated by + * the preprocessed file (*.i*) that triggers the bug, generated by adding -save-temps to the complete compilation command, or, in the - case of a bug report for the GNAT front end, a complete set of + case of a bug report for the GNAT front end, a complete set of source files (see below). What we do not want @@ -67,133 +67,133 @@ Summarized bug reporting instructions * A source file that #includes header files that are left out of the bug report (see above) * That source file and a collection of header files. - * An attached archive (tar, zip, shar, whatever) containing all (or + * An attached archive (tar, zip, shar, whatever) containing all (or some :-) of the above. - * A code snippet that won't cause the compiler to produce the exact - output mentioned in the bug report (e.g., a snippet with just a - few lines around the one that apparently triggers the bug, with - some pieces replaced with ellipses or comments for extra + * A code snippet that won't cause the compiler to produce the exact + output mentioned in the bug report (e.g., a snippet with just a + few lines around the one that apparently triggers the bug, with + some pieces replaced with ellipses or comments for extra obfuscation :-) - * The location (URL) of the package that failed to build (we won't + * The location (URL) of the package that failed to build (we won't download it, anyway, since you've already given us what we need to duplicate the bug, haven't you? :-) - * An error that occurs only some of the times a certain file is - compiled, such that retrying a sufficient number of times results - in a successful compilation; this is a symptom of a hardware + * An error that occurs only some of the times a certain file is + compiled, such that retrying a sufficient number of times results + in a successful compilation; this is a symptom of a hardware problem, not of a compiler bug (sorry) - * Assembly files (*.s) produced by the compiler, or any binary - files, such as object files, executables, core files, or + * Assembly files (*.s) produced by the compiler, or any binary + files, such as object files, executables, core files, or precompiled header files - * Duplicate bug reports, or reports of bugs already fixed in the + * Duplicate bug reports, or reports of bugs already fixed in the development tree, especially those that have already been reported as fixed last week :-) - * Bugs in the assembler, the linker or the C library. These are - separate projects, with separate mailing lists and different bug + * Bugs in the assembler, the linker or the C library. These are + separate projects, with separate mailing lists and different bug reporting procedures - * Bugs in releases or snapshots of GCC not issued by the GNU + * Bugs in releases or snapshots of GCC not issued by the GNU Project. Report them to whoever provided you with the release - * Questions about the correctness or the expected behavior of + * Questions about the correctness or the expected behavior of certain constructs that are not GCC extensions. Ask them in forums dedicated to the discussion of the programming language Where to post it - Please submit your bug report directly to the [20]GCC bug database. - Alternatively, you can use the gccbug script that mails your bug + Please submit your bug report directly to the [20]GCC bug database. + Alternatively, you can use the gccbug script that mails your bug report to the bug database. - Only if all this is absolutely impossible, mail all information to + Only if all this is absolutely impossible, mail all information to [21]gcc-bugs@gcc.gnu.org. Detailed bug reporting instructions - Please refer to the [22]next section when reporting bugs in GNAT, the - Ada compiler, or to the [23]one after that when reporting bugs that + Please refer to the [22]next section when reporting bugs in GNAT, the + Ada compiler, or to the [23]one after that when reporting bugs that appear when using a precompiled header. - In general, all the information we need can be obtained by collecting - the command line below, as well as its output and the preprocessed + In general, all the information we need can be obtained by collecting + the command line below, as well as its output and the preprocessed file it generates. gcc -v -save-temps all-your-options source-file - The only excuses to not send us the preprocessed sources are (i) if - you've found a bug in the preprocessor, (ii) if you've reduced the - testcase to a small file that doesn't include any other file or (iii) - if the bug appears only when using precompiled headers. If you can't - post the preprocessed sources because they're proprietary code, then + The only excuses to not send us the preprocessed sources are (i) if + you've found a bug in the preprocessor, (ii) if you've reduced the + testcase to a small file that doesn't include any other file or (iii) + if the bug appears only when using precompiled headers. If you can't + post the preprocessed sources because they're proprietary code, then try to create a small file that triggers the same problem. - Since we're supposed to be able to re-create the assembly output - (extension .s), you usually should not include it in the bug report, - although you may want to post parts of it to point out assembly code + Since we're supposed to be able to re-create the assembly output + (extension .s), you usually should not include it in the bug report, + although you may want to post parts of it to point out assembly code you consider to be wrong. - Please avoid posting an archive (.tar, .shar or .zip); we generally - need just a single file to reproduce the bug (the .i/.ii/.f - preprocessed file), and, by storing it in an archive, you're just + Please avoid posting an archive (.tar, .shar or .zip); we generally + need just a single file to reproduce the bug (the .i/.ii/.f + preprocessed file), and, by storing it in an archive, you're just making our volunteers' jobs harder. Only when your bug report requires multiple source files to be reproduced should you use an archive. This - is, for example, the case if you are using INCLUDE directives in - Fortran code, which are not processed by the preprocessor, but the - compiler. In that case, we need the main file and all INCLUDEd files. - In any case, make sure the compiler version, error message, etc, are - included in the body of your bug report as plain text, even if + is, for example, the case if you are using INCLUDE directives in + Fortran code, which are not processed by the preprocessor, but the + compiler. In that case, we need the main file and all INCLUDEd files. + In any case, make sure the compiler version, error message, etc, are + included in the body of your bug report as plain text, even if needlessly duplicated as part of an archive. Detailed bug reporting instructions for GNAT - See the [24]previous section for bug reporting instructions for GCC + See the [24]previous section for bug reporting instructions for GCC language implementations other than Ada. - Bug reports have to contain at least the following information in + Bug reports have to contain at least the following information in order to be useful: * the exact version of GCC, as shown by "gcc -v"; * the system type; * the options when GCC was configured/built; - * the exact command line passed to the gcc program triggering the - bug (not just the flags passed to gnatmake, but gnatmake prints + * the exact command line passed to the gcc program triggering the + bug (not just the flags passed to gnatmake, but gnatmake prints the parameters it passed to gcc) * a collection of source files for reproducing the bug, preferably a minimal set (see below); * a description of the expected behavior; * a description of actual behavior. - If your code depends on additional source files (usually package + If your code depends on additional source files (usually package specifications), submit the source code for these compilation units in - a single file that is acceptable input to gnatchop, i.e. contains no - non-Ada text. If the compilation terminated normally, you can usually + a single file that is acceptable input to gnatchop, i.e. contains no + non-Ada text. If the compilation terminated normally, you can usually obtain a list of dependencies using the "gnatls -d main_unit" command, - where main_unit is the file name of the main compilation unit (which + where main_unit is the file name of the main compilation unit (which is also passed to gcc). - If you report a bug which causes the compiler to print a bug box, + If you report a bug which causes the compiler to print a bug box, include that bug box in your report, and do not forget to send all the source files listed after the bug box along with your report. - If you use gnatprep, be sure to send in preprocessed sources (unless + If you use gnatprep, be sure to send in preprocessed sources (unless you have to report a bug in gnatprep). - When you have checked that your report meets these criteria, please - submit it according to our [25]generic instructions. (If you use a - mailing list for reporting, please include an "[Ada]" tag in the + When you have checked that your report meets these criteria, please + submit it according to our [25]generic instructions. (If you use a + mailing list for reporting, please include an "[Ada]" tag in the subject.) Detailed bug reporting instructions when using a precompiled header - If you're encountering a bug when using a precompiled header, the + If you're encountering a bug when using a precompiled header, the first thing to do is to delete the precompiled header, and try running - the same GCC command again. If the bug happens again, the bug doesn't - really involve precompiled headers, please report it without using + the same GCC command again. If the bug happens again, the bug doesn't + really involve precompiled headers, please report it without using them by following the instructions [26]above. - If you've found a bug while building a precompiled header (for - instance, the compiler crashes), follow the usual instructions + If you've found a bug while building a precompiled header (for + instance, the compiler crashes), follow the usual instructions [27]above. - If you've found a real precompiled header bug, what we'll need to - reproduce it is the sources to build the precompiled header (as a + If you've found a real precompiled header bug, what we'll need to + reproduce it is the sources to build the precompiled header (as a single .i file), the source file that uses the precompiled header, any - other headers that source file includes, and the command lines that + other headers that source file includes, and the command lines that you used to build the precompiled header and to use it. Please don't send us the actual precompiled header. It is likely to be @@ -202,14 +202,14 @@ Detailed bug reporting instructions when using a precompiled header Frequently Reported Bugs in GCC - This is a list of bugs in GCC that are reported very often, but not - yet fixed. While it is certainly better to fix bugs instead of - documenting them, this document might save people the effort of + This is a list of bugs in GCC that are reported very often, but not + yet fixed. While it is certainly better to fix bugs instead of + documenting them, this document might save people the effort of writing a bug report when the bug is already well-known. - There are many reasons why a reported bug doesn't get fixed. It might - be difficult to fix, or fixing it might break compatibility. Often, - reports get a low priority when there is a simple work-around. In + There are many reasons why a reported bug doesn't get fixed. It might + be difficult to fix, or fixing it might break compatibility. Often, + reports get a low priority when there is a simple work-around. In particular, bugs caused by invalid code have a simple work-around: fix the code. _________________________________________________________________ @@ -219,21 +219,21 @@ C++ Missing features The export keyword is not implemented. - Most C++ compilers (G++ included) do not yet implement export, - which is necessary for separate compilation of template - declarations and definitions. Without export, a template - definition must be in scope to be used. The obvious workaround - is simply to place all definitions in the header itself. - Alternatively, the compilation unit containing template + Most C++ compilers (G++ included) do not yet implement export, + which is necessary for separate compilation of template + declarations and definitions. Without export, a template + definition must be in scope to be used. The obvious workaround + is simply to place all definitions in the header itself. + Alternatively, the compilation unit containing template definitions may be included from the header. Bugs fixed in the 3.4 series - The following bugs are present up to (and including) GCC 3.3.x. They + The following bugs are present up to (and including) GCC 3.3.x. They have been fixed in 3.4.0. Two-stage name-lookup. - GCC did not implement two-stage name-lookup (also see + GCC did not implement two-stage name-lookup (also see [28]below). Covariant return types. @@ -262,57 +262,57 @@ A bar() return (A()); // return A temporary } - Although being valid code, each of the three lines with a - comment was rejected by GCC. The work-arounds for older + Although being valid code, each of the three lines with a + comment was rejected by GCC. The work-arounds for older compiler versions proposed below do not change the semantics of the programs at all. The problem in the first case was that GCC started to parse the - declaration of b as a function called b returning B, taking a + declaration of b as a function called b returning B, taking a function returning A as an argument. When it encountered the 1, - it was too late. To show the compiler that this should be - really an expression, a comma operator with a dummy argument + it was too late. To show the compiler that this should be + really an expression, a comma operator with a dummy argument could be used: B b((0,A()),A(1)); - The work-around for simpler cases like the second one was to - add additional parentheses around the expressions that were + The work-around for simpler cases like the second one was to + add additional parentheses around the expressions that were mistaken as declarations: (B(A(2))).foo(); In the third case, however, additional parentheses were causing - the problems: The compiler interpreted A() as a function + the problems: The compiler interpreted A() as a function (taking no arguments, returning A), and (A()) as a cast lacking - an expression to be casted, hence the parse error. The + an expression to be casted, hence the parse error. The work-around was to omit the parentheses: return A(); - This problem occurred in a number of variants; in throw - statements, people also frequently put the object in + This problem occurred in a number of variants; in throw + statements, people also frequently put the object in parentheses. _________________________________________________________________ Fortran - Fortran bugs are documented in the G77 manual rather than explicitly - listed here. Please see [29]Known Causes of Trouble with GNU Fortran + Fortran bugs are documented in the G77 manual rather than explicitly + listed here. Please see [29]Known Causes of Trouble with GNU Fortran in the G77 manual. _________________________________________________________________ Non-bugs - The following are not actually bugs, but are reported often enough to + The following are not actually bugs, but are reported often enough to warrant a mention here. - It is not always a bug in the compiler, if code which "worked" in a - previous version, is now rejected. Earlier versions of GCC sometimes + It is not always a bug in the compiler, if code which "worked" in a + previous version, is now rejected. Earlier versions of GCC sometimes were less picky about standard conformance and accepted invalid source - code. In addition, programming languages themselves change, rendering - code invalid that used to be conforming (this holds especially for - C++). In either case, you should update your code to match recent + code. In addition, programming languages themselves change, rendering + code invalid that used to be conforming (this holds especially for + C++). In either case, you should update your code to match recent language standards. _________________________________________________________________ @@ -320,7 +320,7 @@ General Problems with floating point numbers - the [30]most often reported non-bug. - In a number of cases, GCC appears to perform floating point + In a number of cases, GCC appears to perform floating point computations incorrectly. For example, the C++ program #include @@ -333,16 +333,16 @@ int main() return 0; } - might print 50 on some systems and optimization levels, and 49 + might print 50 on some systems and optimization levels, and 49 on others. - This is the result of rounding: The computer cannot represent + This is the result of rounding: The computer cannot represent all real numbers exactly, so it has to use approximations. When - computing with approximation, the computer needs to round to + computing with approximation, the computer needs to round to the nearest representable number. - This is not a bug in the compiler, but an inherent limitation - of the floating point types. Please study [31]this paper for + This is not a bug in the compiler, but an inherent limitation + of the floating point types. Please study [31]this paper for more information. _________________________________________________________________ @@ -357,14 +357,14 @@ foo(i,++i) i*(++i) /* special case with foo=="operator*" */ std::cout << i << ++i /* foo(foo(std::cout,i),++i) */ - since the i without increment can be evaluated before or after + since the i without increment can be evaluated before or after ++i. - The C and C++ standards have the notion of "sequence points". - Everything that happens between two sequence points happens in - an unspecified order, but it has to happen after the first and - before the second sequence point. The end of a statement and a - function call are examples for sequence points, whereas + The C and C++ standards have the notion of "sequence points". + Everything that happens between two sequence points happens in + an unspecified order, but it has to happen after the first and + before the second sequence point. The end of a statement and a + function call are examples for sequence points, whereas assignments and the comma between function arguments are not. Modifying a value twice between two sequence points as shown in @@ -375,15 +375,15 @@ foo(++i,++i) (++i)*(++i) /* special case with foo=="operator*" */ std::cout << ++i << ++i /* foo(foo(std::cout,++i),++i) */ - This leads to undefined behavior (i.e. the compiler can do + This leads to undefined behavior (i.e. the compiler can do anything). Casting does not work as expected when optimization is turned on. - This is often caused by a violation of aliasing rules, which - are part of the ISO C standard. These rules say that a program + This is often caused by a violation of aliasing rules, which + are part of the ISO C standard. These rules say that a program is invalid if you try to access a variable through a pointer of - an incompatible type. This is happening in the following - example where a short is accessed through a pointer to integer + an incompatible type. This is happening in the following + example where a short is accessed through a pointer to integer (the code assumes 16-bit shorts and 32-bit ints): #include @@ -401,35 +401,35 @@ int main() return 0; } - The aliasing rules were designed to allow compilers more - aggressive optimization. Basically, a compiler can assume that - all changes to variables happen through pointers or references - to variables of a type compatible to the accessed variable. - Dereferencing a pointer that violates the aliasing rules + The aliasing rules were designed to allow compilers more + aggressive optimization. Basically, a compiler can assume that + all changes to variables happen through pointers or references + to variables of a type compatible to the accessed variable. + Dereferencing a pointer that violates the aliasing rules results in undefined behavior. - In the case above, the compiler may assume that no access - through an integer pointer can change the array a, consisting - of shorts. Thus, printf may be called with the original values + In the case above, the compiler may assume that no access + through an integer pointer can change the array a, consisting + of shorts. Thus, printf may be called with the original values of a[0] and a[1]. What really happens is up to the compiler and may change with architecture and optimization level. - Recent versions of GCC turn on the option -fstrict-aliasing - (which allows alias-based optimizations) by default with -O2. + Recent versions of GCC turn on the option -fstrict-aliasing + (which allows alias-based optimizations) by default with -O2. And some architectures then really print "1111 1111" as result. - Without optimization the executable will generate the + Without optimization the executable will generate the "expected" output "2222 2222". - To disable optimizations based on alias-analysis for faulty - legacy code, the option -fno-strict-aliasing can be used as a + To disable optimizations based on alias-analysis for faulty + legacy code, the option -fno-strict-aliasing can be used as a work-around. The option -Wstrict-aliasing (which is included in -Wall) warns about some - but not all - cases of violation of aliasing rules when -fstrict-aliasing is active. - To fix the code above, you can use a union instead of a cast - (note that this is a GCC extension which might not work with + To fix the code above, you can use a union instead of a cast + (note that this is a GCC extension which might not work with other compilers): #include @@ -453,11 +453,11 @@ int main() Now the result will always be "2222 2222". - For some more insight into the subject, please have a look at + For some more insight into the subject, please have a look at [33]this article. Cannot use preprocessor directive in macro arguments. - Let me guess... you used an older version of GCC to compile + Let me guess... you used an older version of GCC to compile code that looks something like this: memcpy(dest, src, @@ -479,23 +479,23 @@ test.c:8: undefined or invalid # directive test.c:9: parse error before `24' test.c:10: undefined or invalid # directive - This is because your C library's happens to define - memcpy as a macro - which is perfectly legitimate. In recent + This is because your C library's happens to define + memcpy as a macro - which is perfectly legitimate. In recent versions of glibc, for example, printf is among those functions which are implemented as macros. - Versions of GCC prior to 3.3 did not allow you to put #ifdef + Versions of GCC prior to 3.3 did not allow you to put #ifdef (or any other preprocessor directive) inside the arguments of a macro. The code therefore would not compile. As of GCC 3.3 this kind of construct is always accepted and the - preprocessor will probably do what you expect, but see the + preprocessor will probably do what you expect, but see the manual for detailed semantics. - However, this kind of code is not portable. It is "undefined - behavior" according to the C standard; that means different - compilers may do different things with it. It is always - possible to rewrite code which uses conditionals inside macros + However, this kind of code is not portable. It is "undefined + behavior" according to the C standard; that means different + compilers may do different things with it. It is always + possible to rewrite code which uses conditionals inside macros so that it doesn't. You could write the above example #ifdef PLATFORM1 @@ -504,32 +504,32 @@ test.c:10: undefined or invalid # directive memcpy(dest, src, 24); #endif - This is a bit more typing, but I personally think it's better + This is a bit more typing, but I personally think it's better style in addition to being more portable. Cannot initialize a static variable with stdin. - This has nothing to do with GCC, but people ask us about it a + This has nothing to do with GCC, but people ask us about it a lot. Code like this: #include FILE *yyin = stdin; - will not compile with GNU libc, because stdin is not a - constant. This was done deliberately, to make it easier to - maintain binary compatibility when the type FILE needs to be + will not compile with GNU libc, because stdin is not a + constant. This was done deliberately, to make it easier to + maintain binary compatibility when the type FILE needs to be changed. It is surprising for people used to traditional Unix C libraries, but it is permitted by the C standard. - This construct commonly occurs in code generated by old - versions of lex or yacc. We suggest you try regenerating the - parser with a current version of flex or bison, respectively. - In your own code, the appropriate fix is to move the + This construct commonly occurs in code generated by old + versions of lex or yacc. We suggest you try regenerating the + parser with a current version of flex or bison, respectively. + In your own code, the appropriate fix is to move the initialization to the beginning of main. - There is a common misconception that the GCC developers are - responsible for GNU libc. These are in fact two entirely - separate projects; please check the [34]GNU libc web pages for + There is a common misconception that the GCC developers are + responsible for GNU libc. These are in fact two entirely + separate projects; please check the [34]GNU libc web pages for details. _________________________________________________________________ @@ -537,56 +537,56 @@ C++ Nested classes can access private members and types of the containing class. - Defect report 45 clarifies that nested classes are members of - the class they are nested in, and so are granted access to + Defect report 45 clarifies that nested classes are members of + the class they are nested in, and so are granted access to private members of that class. G++ emits two copies of constructors and destructors. - In general there are three types of constructors (and + In general there are three types of constructors (and destructors). 1. The complete object constructor/destructor. 2. The base object constructor/destructor. 3. The allocating constructor/deallocating destructor. - The first two are different, when virtual base classes are + The first two are different, when virtual base classes are involved. Global destructors are not run in the correct order. - Global destructors should be run in the reverse order of their - constructors completing. In most cases this is the same as the - reverse order of constructors starting, but sometimes it is - different, and that is important. You need to compile and link - your programs with --use-cxa-atexit. We have not turned this - switch on by default, as it requires a cxa aware runtime + Global destructors should be run in the reverse order of their + constructors completing. In most cases this is the same as the + reverse order of constructors starting, but sometimes it is + different, and that is important. You need to compile and link + your programs with --use-cxa-atexit. We have not turned this + switch on by default, as it requires a cxa aware runtime library (libc, glibc, or equivalent). Classes in exception specifiers must be complete types. - [15.4]/1 tells you that you cannot have an incomplete type, or - pointer to incomplete (other than cv void *) in an exception + [15.4]/1 tells you that you cannot have an incomplete type, or + pointer to incomplete (other than cv void *) in an exception specification. Exceptions don't work in multithreaded applications. - You need to rebuild g++ and libstdc++ with --enable-threads. - Remember, C++ exceptions are not like hardware interrupts. You - cannot throw an exception in one thread and catch it in - another. You cannot throw an exception from a signal handler + You need to rebuild g++ and libstdc++ with --enable-threads. + Remember, C++ exceptions are not like hardware interrupts. You + cannot throw an exception in one thread and catch it in + another. You cannot throw an exception from a signal handler and catch it in the main thread. Templates, scoping, and digraphs. - If you have a class in the global namespace, say named X, and + If you have a class in the global namespace, say named X, and want to give it as a template argument to some other class, say std::vector, then std::vector<::X> fails with a parser error. - The reason is that the standard mandates that the sequence <: - is treated as if it were the token [. (There are several such - combinations of characters - they are called digraphs.) - Depending on the version, the compiler then reports a parse - error before the character : (the colon before X) or a missing + The reason is that the standard mandates that the sequence <: + is treated as if it were the token [. (There are several such + combinations of characters - they are called digraphs.) + Depending on the version, the compiler then reports a parse + error before the character : (the colon before X) or a missing closing bracket ]. - The simplest way to avoid this is to write std::vector< ::X>, - i.e. place a space between the opening angle bracket and the + The simplest way to avoid this is to write std::vector< ::X>, + i.e. place a space between the opening angle bracket and the scope operator. Copy constructor access check while initializing a reference. @@ -614,19 +614,19 @@ void bar(void) } Starting with GCC 3.4.0, binding an rvalue to a const reference - requires an accessible copy constructor. This might be - surprising at first sight, especially since most popular + requires an accessible copy constructor. This might be + surprising at first sight, especially since most popular compilers do not correctly implement this rule. The C++ Standard says that a temporary object should be created - in this context and its contents filled with a copy of the - object we are trying to bind to the reference; it also says - that the temporary copy can be elided, but the semantic - constraints (eg. accessibility) of the copy constructor still + in this context and its contents filled with a copy of the + object we are trying to bind to the reference; it also says + that the temporary copy can be elided, but the semantic + constraints (eg. accessibility) of the copy constructor still have to be checked. - For further information, you can consult the following - paragraphs of the C++ standard: [dcl.init.ref]/5, bullet 2, + For further information, you can consult the following + paragraphs of the C++ standard: [dcl.init.ref]/5, bullet 2, sub-bullet 1, and [class.temporary]/2. Common problems when upgrading the compiler @@ -634,81 +634,81 @@ void bar(void) ABI changes The C++ application binary interface (ABI) consists of two components: - the first defines how the elements of classes are laid out, how - functions are called, how function names are mangled, etc; the second + the first defines how the elements of classes are laid out, how + functions are called, how function names are mangled, etc; the second part deals with the internals of the objects in libstdc++. Although we - strive for a non-changing ABI, so far we have had to modify it with - each major release. If you change your compiler to a different major + strive for a non-changing ABI, so far we have had to modify it with + each major release. If you change your compiler to a different major release you must recompile all libraries that contain C++ code. If you - fail to do so you risk getting linker errors or malfunctioning + fail to do so you risk getting linker errors or malfunctioning programs. Some of our Java support libraries also contain C++ code, so you might want to recompile all libraries to be safe. It should not be necessary to recompile if you have changed to a bug-fix release of the - same version of the compiler; bug-fix releases are careful to avoid + same version of the compiler; bug-fix releases are careful to avoid ABI changes. See also the [35]compatibility section of the GCC manual. - Remark: A major release is designated by a change to the first or - second component of the two- or three-part version number. A minor - (bug-fix) release is designated by a change to the third component - only. Thus GCC 3.2 and 3.3 are major releases, while 3.3.1 and 3.3.2 - are bug-fix releases for GCC 3.3. With the 3.4 series we are - introducing a new naming scheme; the first release of this series is + Remark: A major release is designated by a change to the first or + second component of the two- or three-part version number. A minor + (bug-fix) release is designated by a change to the third component + only. Thus GCC 3.2 and 3.3 are major releases, while 3.3.1 and 3.3.2 + are bug-fix releases for GCC 3.3. With the 3.4 series we are + introducing a new naming scheme; the first release of this series is 3.4.0 instead of just 3.4. Standard conformance - With each release, we try to make G++ conform closer to the ISO C++ - standard (available at [36]http://www.ncits.org/cplusplus.htm). We - have also implemented some of the core and library defect reports + With each release, we try to make G++ conform closer to the ISO C++ + standard (available at [36]http://www.ncits.org/cplusplus.htm). We + have also implemented some of the core and library defect reports (available at - [37]http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html & + [37]http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html & [38]http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html respectively). - Non-conforming legacy code that worked with older versions of GCC may - be rejected by more recent compilers. There is no command-line switch - to ensure compatibility in general, because trying to parse - standard-conforming and old-style code at the same time would render - the C++ frontend unmaintainable. However, some non-conforming - constructs are allowed when the command-line option -fpermissive is + Non-conforming legacy code that worked with older versions of GCC may + be rejected by more recent compilers. There is no command-line switch + to ensure compatibility in general, because trying to parse + standard-conforming and old-style code at the same time would render + the C++ frontend unmaintainable. However, some non-conforming + constructs are allowed when the command-line option -fpermissive is used. - Two milestones in standard conformance are GCC 3.0 (including a major - overhaul of the standard library) and the 3.4.0 version (with its new + Two milestones in standard conformance are GCC 3.0 (including a major + overhaul of the standard library) and the 3.4.0 version (with its new C++ parser). New in GCC 3.0 - * The standard library is much more conformant, and uses the std:: + * The standard library is much more conformant, and uses the std:: namespace (which is now a real namespace, not an alias for ::). * The standard header files for the c library don't end with .h, but begin with c (i.e. rather than ). The .h names are still available, but are deprecated. * is deprecated, use instead. - * streambuf::seekoff & streambuf::seekpos are private, instead use + * streambuf::seekoff & streambuf::seekpos are private, instead use streambuf::pubseekoff & streambuf::pubseekpos respectively. * If std::operator << (std::ostream &, long long) doesn't exist, you need to recompile libstdc++ with --enable-long-long. - If you get lots of errors about things like cout not being found, + If you get lots of errors about things like cout not being found, you've most likely forgotten to tell the compiler to look in the std:: namespace. There are several ways to do this: * Say std::cout at the call. This is the most explicit way of saying what you mean. - * Say using std::cout; somewhere before the call. You will need to - do this for each function or type you wish to use from the + * Say using std::cout; somewhere before the call. You will need to + do this for each function or type you wish to use from the standard library. - * Say using namespace std; somewhere before the call. This is the - quick-but-dirty fix. This brings the whole of the std:: namespace - into scope. Never do this in a header file, as every user of your + * Say using namespace std; somewhere before the call. This is the + quick-but-dirty fix. This brings the whole of the std:: namespace + into scope. Never do this in a header file, as every user of your header file will be affected by this decision. New in GCC 3.4.0 - The new parser brings a lot of improvements, especially concerning + The new parser brings a lot of improvements, especially concerning name-lookup. - * The "implicit typename" extension got removed (it was already - deprecated since GCC 3.1), so that the following code is now + * The "implicit typename" extension got removed (it was already + deprecated since GCC 3.1), so that the following code is now rejected, see [14.6]: template struct A @@ -724,7 +724,7 @@ template struct B B b; - * For similar reasons, the following code now requires the template + * For similar reasons, the following code now requires the template keyword, see [14.2]: template struct A @@ -740,7 +740,7 @@ template struct B B b; - * We now have two-stage name-lookup, so that the following code is + * We now have two-stage name-lookup, so that the following code is rejected, see [14.6]/9: template int foo() @@ -766,7 +766,7 @@ template struct B : A int foo5() { return j; } // OK }; - In addition to the problems listed above, the manual contains a + In addition to the problems listed above, the manual contains a section on [39]Common Misunderstandings with GNU C++. References diff --git a/contrib/gcc-3.4/FAQ b/contrib/gcc-3.4/FAQ index a131156693..ed7bfeb211 100644 --- a/contrib/gcc-3.4/FAQ +++ b/contrib/gcc-3.4/FAQ @@ -1,12 +1,12 @@ GCC Frequently Asked Questions - The latest version of this document is always available at + The latest version of this document is always available at [1]http://gcc.gnu.org/faq.html. - This FAQ tries to answer specific questions concerning GCC. For - general information regarding C, C++, resp. Fortran please check the - [2]comp.lang.c FAQ, [3]comp.std.c++ FAQ, and the [4]Fortran + This FAQ tries to answer specific questions concerning GCC. For + general information regarding C, C++, resp. Fortran please check the + [2]comp.lang.c FAQ, [3]comp.std.c++ FAQ, and the [4]Fortran Information page. Other GCC-related FAQs: [5]libstdc++-v3, and [6]GCJ. @@ -34,12 +34,12 @@ 1. [24]Is there a stringstream / sstream for GCC 2.95.2? 5. [25]Miscellaneous 1. [26]Friend Templates - 2. [27]dynamic_cast, throw, typeid don't work with shared + 2. [27]dynamic_cast, throw, typeid don't work with shared libraries 3. [28]Why do I need autoconf, bison, xgettext, automake, etc? 4. [29]Why can't I build a shared library? - 5. [30]When building C++, the linker says my constructors, - destructors or virtual tables are undefined, but I defined + 5. [30]When building C++, the linker says my constructors, + destructors or virtual tables are undefined, but I defined them 6. [31]Will GCC someday include an incremental linker? _________________________________________________________________ @@ -48,101 +48,100 @@ What is the relationship between GCC and EGCS? - In 1990/1991 gcc version 1 had reached a point of stability. For the - targets it could support, it worked well. It had limitations inherent - in its design that would be difficult to resolve, so a major effort - was made to resolve those limitations and gcc version 2 was the + In 1990/1991 gcc version 1 had reached a point of stability. For the + targets it could support, it worked well. It had limitations inherent + in its design that would be difficult to resolve, so a major effort + was made to resolve those limitations and gcc version 2 was the result. - When we had gcc2 in a useful state, development efforts on gcc1 - stopped and we all concentrated on making gcc2 better than gcc1 could - ever be. This is the kind of step forward we wanted to make with the + When we had gcc2 in a useful state, development efforts on gcc1 + stopped and we all concentrated on making gcc2 better than gcc1 could + ever be. This is the kind of step forward we wanted to make with the EGCS project when it was formed in 1997. - In April 1999 the Free Software Foundation officially halted + In April 1999 the Free Software Foundation officially halted development on the gcc2 compiler and appointed the EGCS project as the - official GCC maintainers. The net result was a single project which - carries forward GCC development under the ultimate control of the + official GCC maintainers. The net result was a single project which + carries forward GCC development under the ultimate control of the [32]GCC Steering Committee. _________________________________________________________________ What is an open development model? - We are using a bazaar style [33][1] approach to GCC development: we - make snapshots publicly available to anyone who wants to try them; we - welcome anyone to join the development mailing list. All of the + We are using a bazaar style [33][1] approach to GCC development: we + make snapshots publicly available to anyone who wants to try them; we + welcome anyone to join the development mailing list. All of the discussions on the development mailing list are available via the web. - We're going to be making releases with a much higher frequency than + We're going to be making releases with a much higher frequency than they have been made in the past. - In addition to weekly snapshots of the GCC development sources, we - have the sources readable from a CVS server by anyone. Furthermore we - are using remote CVS to allow remote maintainers write access to the - sources. + In addition to weekly snapshots of the GCC development sources, we + have the sources readable from an SVN server by anyone. Furthermore we + are using SVN to allow maintainers write access to the sources. - There have been many potential GCC developers who were not able to - participate in GCC development in the past. We want these people to - help in any way they can; we ultimately want GCC to be the best + There have been many potential GCC developers who were not able to + participate in GCC development in the past. We want these people to + help in any way they can; we ultimately want GCC to be the best compiler in the world. - A compiler is a complicated piece of software, there will still be - strong central maintainers who will reject patches, who will demand - documentation of implementations, and who will keep the level of - quality as high as it is today. Code that could use wider testing may + A compiler is a complicated piece of software, there will still be + strong central maintainers who will reject patches, who will demand + documentation of implementations, and who will keep the level of + quality as high as it is today. Code that could use wider testing may be integrated--code that is simply ill-conceived won't be. - GCC is not the first piece of software to use this open development - process; FreeBSD, the Emacs lisp repository, and the Linux kernel are + GCC is not the first piece of software to use this open development + process; FreeBSD, the Emacs lisp repository, and the Linux kernel are a few examples of the bazaar style of development. - With GCC, we are adding new features and optimizations at a rate that - has not been done since the creation of gcc2; these additions - inevitably have a temporarily destabilizing effect. With the help of - developers working together with this bazaar style development, the - resulting stability and quality levels will be better than we've had + With GCC, we are adding new features and optimizations at a rate that + has not been done since the creation of gcc2; these additions + inevitably have a temporarily destabilizing effect. With the help of + developers working together with this bazaar style development, the + resulting stability and quality levels will be better than we've had before. - [1] We've been discussing different development models a lot over + [1] We've been discussing different development models a lot over the past few months. The paper which started all of this introduced - two terms: A cathedral development model versus a bazaar - development model. The paper is written by Eric S. Raymond, it is - called ``The Cathedral and the Bazaar''. The paper is a useful + two terms: A cathedral development model versus a bazaar + development model. The paper is written by Eric S. Raymond, it is + called ``The Cathedral and the Bazaar''. The paper is a useful starting point for discussions. _________________________________________________________________ How do I get a bug fixed or a feature added? - There are lots of ways to get something fixed. The list below may be - incomplete, but it covers many of the common cases. These are listed - roughly in order of decreasing difficulty for the average GCC user, - meaning someone who is not skilled in the internals of GCC, and where - difficulty is measured in terms of the time required to fix the bug. - No alternative is better than any other; each has its benefits and + There are lots of ways to get something fixed. The list below may be + incomplete, but it covers many of the common cases. These are listed + roughly in order of decreasing difficulty for the average GCC user, + meaning someone who is not skilled in the internals of GCC, and where + difficulty is measured in terms of the time required to fix the bug. + No alternative is better than any other; each has its benefits and disadvantages. - * Fix it yourself. This alternative will probably bring results, if - you work hard enough, but will probably take a lot of time, and, - depending on the quality of your work and the perceived benefits - of your changes, your code may or may not ever make it into an + * Fix it yourself. This alternative will probably bring results, if + you work hard enough, but will probably take a lot of time, and, + depending on the quality of your work and the perceived benefits + of your changes, your code may or may not ever make it into an official release of GCC. - * [34]Report the problem to the GCC bug tracking system and hope - that someone will be kind enough to fix it for you. While this is - certainly possible, and often happens, there is no guarantee that - it will. You should not expect the same response from this method - that you would see from a commercial support organization since - the people who read GCC bug reports, if they choose to help you, + * [34]Report the problem to the GCC bug tracking system and hope + that someone will be kind enough to fix it for you. While this is + certainly possible, and often happens, there is no guarantee that + it will. You should not expect the same response from this method + that you would see from a commercial support organization since + the people who read GCC bug reports, if they choose to help you, will be volunteering their time. - * Hire someone to fix it for you. There are various companies and - individuals providing support for GCC. This alternative costs + * Hire someone to fix it for you. There are various companies and + individuals providing support for GCC. This alternative costs money, but is relatively likely to get results. _________________________________________________________________ Does GCC work on my platform? - The host/target specific installation notes for GCC include - information about known problems with installing or using GCC on - particular platforms. These are included in the sources for a release - in INSTALL/specific.html, and the [35]latest version is always - available at the GCC web site. Reports of [36]successful builds for + The host/target specific installation notes for GCC include + information about known problems with installing or using GCC on + particular platforms. These are included in the sources for a release + in INSTALL/specific.html, and the [35]latest version is always + available at the GCC web site. Reports of [36]successful builds for several versions of GCC are also available at the web site. _________________________________________________________________ @@ -150,51 +149,51 @@ Does GCC work on my platform? How to install multiple versions of GCC - It may be desirable to install multiple versions of the compiler on - the same system. This can be done by using different prefix paths at + It may be desirable to install multiple versions of the compiler on + the same system. This can be done by using different prefix paths at configure time and a few symlinks. - Basically, configure the two compilers with different --prefix - options, then build and install each compiler. Assume you want "gcc" + Basically, configure the two compilers with different --prefix + options, then build and install each compiler. Assume you want "gcc" to be the latest compiler and available in /usr/local/bin; also assume - that you want "gcc2" to be the older gcc2 compiler and also available + that you want "gcc2" to be the older gcc2 compiler and also available in /usr/local/bin. - The easiest way to do this is to configure the new GCC with - --prefix=/usr/local/gcc and the older gcc2 with - --prefix=/usr/local/gcc2. Build and install both compilers. Then make - a symlink from /usr/local/bin/gcc to /usr/local/gcc/bin/gcc and from - /usr/local/bin/gcc2 to /usr/local/gcc2/bin/gcc. Create similar links + The easiest way to do this is to configure the new GCC with + --prefix=/usr/local/gcc and the older gcc2 with + --prefix=/usr/local/gcc2. Build and install both compilers. Then make + a symlink from /usr/local/bin/gcc to /usr/local/gcc/bin/gcc and from + /usr/local/bin/gcc2 to /usr/local/gcc2/bin/gcc. Create similar links for the "g++", "c++" and "g77" compiler drivers. - An alternative to using symlinks is to configure with a - --program-transform-name option. This option specifies a sed command - to process installed program names with. Using it you can, for + An alternative to using symlinks is to configure with a + --program-transform-name option. This option specifies a sed command + to process installed program names with. Using it you can, for instance, have all the new GCC programs installed as "new-gcc" and the - like. You will still have to specify different --prefix options for - new GCC and old GCC, because it is only the executable program names + like. You will still have to specify different --prefix options for + new GCC and old GCC, because it is only the executable program names that are transformed. The difference is that you (as administrator) do - not have to set up symlinks, but must specify additional directories + not have to set up symlinks, but must specify additional directories in your (as a user) PATH. A complication with --program-transform-name - is that the sed command invariably contains characters significant to - the shell, and these have to be escaped correctly, also it is not - possible to use "^" or "$" in the command. Here is the option to + is that the sed command invariably contains characters significant to + the shell, and these have to be escaped correctly, also it is not + possible to use "^" or "$" in the command. Here is the option to prefix "new-" to the new GCC installed programs: --program-transform-name='s,\\\\(.*\\\\),new-\\\\1,' With the above --prefix option, that will install the new GCC programs - into /usr/local/gcc/bin with names prefixed by "new-". You can use - --program-transform-name if you have multiple versions of GCC, and + into /usr/local/gcc/bin with names prefixed by "new-". You can use + --program-transform-name if you have multiple versions of GCC, and wish to be sure about which version you are invoking. - If you use --prefix, GCC may have difficulty locating a GNU assembler - or linker on your system, [37]GCC can not find GNU as/GNU ld explains + If you use --prefix, GCC may have difficulty locating a GNU assembler + or linker on your system, [37]GCC can not find GNU as/GNU ld explains how to deal with this. - Another option that may be easier is to use the --program-prefix= or - --program-suffix= options to configure. So if you're installing GCC - 2.95.2 and don't want to disturb the current version of GCC in + Another option that may be easier is to use the --program-prefix= or + --program-suffix= options to configure. So if you're installing GCC + 2.95.2 and don't want to disturb the current version of GCC in /usr/local/bin/, you could do configure --program-suffix=-2.95.2 @@ -206,88 +205,88 @@ How to install multiple versions of GCC Dynamic linker is unable to find GCC libraries This problem manifests itself by programs not finding shared libraries - they depend on when the programs are started. Note this problem often - manifests itself with failures in the libio/libstdc++ tests after + they depend on when the programs are started. Note this problem often + manifests itself with failures in the libio/libstdc++ tests after configuring with --enable-shared and building GCC. - GCC does not specify a runpath so that the dynamic linker can find + GCC does not specify a runpath so that the dynamic linker can find dynamic libraries at runtime. - The short explanation is that if you always pass a -R option to the - linker, then your programs become dependent on directories which may + The short explanation is that if you always pass a -R option to the + linker, then your programs become dependent on directories which may be NFS mounted, and programs may hang unnecessarily when an NFS server goes down. - The problem is not programs that do require the directories; those - programs are going to hang no matter what you do. The problem is + The problem is not programs that do require the directories; those + programs are going to hang no matter what you do. The problem is programs that do not require the directories. - SunOS effectively always passed a -R option for every -L option; this - was a bad idea, and so it was removed for Solaris. We should not + SunOS effectively always passed a -R option for every -L option; this + was a bad idea, and so it was removed for Solaris. We should not recreate it. - However, if you feel you really need such an option to be passed - automatically to the linker, you may add it to the GCC specs file. - This file can be found in the same directory that contains cc1 (run + However, if you feel you really need such an option to be passed + automatically to the linker, you may add it to the GCC specs file. + This file can be found in the same directory that contains cc1 (run gcc -print-prog-name=cc1 to find it). You may add linker flags such as - -R or -rpath, depending on platform and linker, to the *link or *lib + -R or -rpath, depending on platform and linker, to the *link or *lib specs. - Another alternative is to install a wrapper script around gcc, g++ or - ld that adds the appropriate directory to the environment variable + Another alternative is to install a wrapper script around gcc, g++ or + ld that adds the appropriate directory to the environment variable LD_RUN_PATH or equivalent (again, it's platform-dependent). Yet another option, that works on a few platforms, is to hard-code the - full pathname of the library into its soname. This can only be - accomplished by modifying the appropriate .ml file within + full pathname of the library into its soname. This can only be + accomplished by modifying the appropriate .ml file within libstdc++/config (and also libg++/config, if you are building libg++), - so that $(libdir)/ appears just before the library name in -soname or + so that $(libdir)/ appears just before the library name in -soname or -h options. _________________________________________________________________ GCC can not find GNU as/GNU ld - GCC searches the PATH for an assembler and a loader, but it only does + GCC searches the PATH for an assembler and a loader, but it only does so after searching a directory list hard-coded in the GCC executables. - Since, on most platforms, the hard-coded list includes directories in - which the system assembler and loader can be found, you may have to - take one of the following actions to arrange that GCC uses the GNU + Since, on most platforms, the hard-coded list includes directories in + which the system assembler and loader can be found, you may have to + take one of the following actions to arrange that GCC uses the GNU versions of those programs. To ensure that GCC finds the GNU assembler (the GNU loader), which are - required by [38]some configurations, you should configure these with + required by [38]some configurations, you should configure these with the same --prefix option as you used for GCC. Then build & install GNU as (GNU ld) and proceed with building GCC. - Another alternative is to create links to GNU as and ld in any of the - directories printed by the command `gcc -print-search-dirs | grep - '^programs:''. The link to `ld' should be named `real-ld' if `ld' + Another alternative is to create links to GNU as and ld in any of the + directories printed by the command `gcc -print-search-dirs | grep + '^programs:''. The link to `ld' should be named `real-ld' if `ld' already exists. If such links do not exist while you're compiling GCC, - you may have to create them in the build directories too, within the + you may have to create them in the build directories too, within the gcc directory and in all the gcc/stage* subdirectories. - GCC 2.95 allows you to specify the full pathname of the assembler and + GCC 2.95 allows you to specify the full pathname of the assembler and the linker to use. The configure flags are `--with-as=/path/to/as' and - `--with-ld=/path/to/ld'. GCC will try to use these pathnames before - looking for `as' or `(real-)ld' in the standard search dirs. If, at - configure-time, the specified programs are found to be GNU utilities, + `--with-ld=/path/to/ld'. GCC will try to use these pathnames before + looking for `as' or `(real-)ld' in the standard search dirs. If, at + configure-time, the specified programs are found to be GNU utilities, `--with-gnu-as' and `--with-gnu-ld' need not be used; these flags will - be auto-detected. One drawback of this option is that it won't allow - you to override the search path for assembler and linker with + be auto-detected. One drawback of this option is that it won't allow + you to override the search path for assembler and linker with command-line options -B/path/ if the specified filenames exist. _________________________________________________________________ cpp: Usage:... Error - If you get an error like this when building GCC (particularly when - building __mulsi3), then you likely have a problem with your + If you get an error like this when building GCC (particularly when + building __mulsi3), then you likely have a problem with your environment variables. cpp: Usage: /usr/lib/gcc-lib/i586-unknown-linux-gnulibc1/2.7.2.3/cpp [switches] input output - First look for an explicit '.' in either LIBRARY_PATH or - GCC_EXEC_PREFIX from your environment. If you do not find an explicit - '.', look for an empty pathname in those variables. Note that ':' at + First look for an explicit '.' in either LIBRARY_PATH or + GCC_EXEC_PREFIX from your environment. If you do not find an explicit + '.', look for an empty pathname in those variables. Note that ':' at either the start or end of these variables is an implicit '.' and will cause problems. @@ -296,28 +295,28 @@ cpp: Usage:... Error Optimizing the compiler itself - If you want to test a particular optimization option, it's useful to - try bootstrapping the compiler with that option turned on. For + If you want to test a particular optimization option, it's useful to + try bootstrapping the compiler with that option turned on. For example, to test the -fssa option, you could bootstrap like this: make BOOT_CFLAGS="-O2 -fssa" bootstrap _________________________________________________________________ Why does libiconv get linked into jc1 on Solaris? - The Java front end requires iconv. If the compiler used to bootstrap - GCC finds libiconv (because the GNU version of libiconv has been + The Java front end requires iconv. If the compiler used to bootstrap + GCC finds libiconv (because the GNU version of libiconv has been installed in the same prefix as the bootstrap compiler), but the newly built GCC does not find the library (because it will be installed with - a different prefix), then a link-time error will occur when building - jc1. This problem does not show up so often on platforms that have - libiconv in a default location (like /usr/lib) because then both - compilers can find a library named libiconv, even though it is a + a different prefix), then a link-time error will occur when building + jc1. This problem does not show up so often on platforms that have + libiconv in a default location (like /usr/lib) because then both + compilers can find a library named libiconv, even though it is a different library. - Using --disable-nls at configure-time does not prevent this problem - because jc1 uses iconv even in that case. Solutions include - temporarily removing the GNU libiconv, copying it to a default - location such as /usr/lib/, and using --enable-languages at + Using --disable-nls at configure-time does not prevent this problem + because jc1 uses iconv even in that case. Solutions include + temporarily removing the GNU libiconv, copying it to a default + location such as /usr/lib/, and using --enable-languages at configure-time to disable Java. _________________________________________________________________ @@ -325,11 +324,11 @@ Why does libiconv get linked into jc1 on Solaris? How do I pass flags like -fnew-abi to the testsuite? - If you invoke runtest directly, you can use the --tool_opts option, + If you invoke runtest directly, you can use the --tool_opts option, e.g: runtest --tool_opts "-fnew-abi -fno-honor-std" - Or, if you use make check you can use the make variable RUNTESTFLAGS, + Or, if you use make check you can use the make variable RUNTESTFLAGS, e.g: make RUNTESTFLAGS="--tool_opts '-fnew-abi -fno-honor-std'" check-g++ _________________________________________________________________ @@ -340,11 +339,11 @@ How can I run the test suite with multiple options? e.g: runtest --target_board "unix{-fPIC,-fpic,}" - Or, if you use make check you can use the make variable RUNTESTFLAGS, + Or, if you use make check you can use the make variable RUNTESTFLAGS, e.g: make RUNTESTFLAGS="--target_board 'unix{-fPIC,-fpic,}'" check-gcc - Either of these examples will run the tests three times. Once with + Either of these examples will run the tests three times. Once with -fPIC, once with -fpic, and once with no additional flags. This technique is particularly useful on multilibbed targets. @@ -363,24 +362,24 @@ Is there a stringstream / sstream for GCC 2.95.2? Friend Templates In order to make a specialization of a template function a friend of a - (possibly template) class, you must explicitly state that the friend - function is a template, by appending angle brackets to its name, and - this template function must have been declared already. Here's an + (possibly template) class, you must explicitly state that the friend + function is a template, by appending angle brackets to its name, and + this template function must have been declared already. Here's an example: template class foo { friend void bar(foo); } - The above declaration declares a non-template function named bar, so - it must be explicitly defined for each specialization of foo. A - template definition of bar won't do, because it is unrelated with the + The above declaration declares a non-template function named bar, so + it must be explicitly defined for each specialization of foo. A + template definition of bar won't do, because it is unrelated with the non-template declaration above. So you'd have to end up writing: void bar(foo) { /* ... */ } void bar(foo) { /* ... */ } - If you meant bar to be a template function, you should have + If you meant bar to be a template function, you should have forward-declared it as follows. Note that, since the template function - declaration refers to the template class, the template class must be + declaration refers to the template class, the template class must be forward-declared too: template class foo; @@ -396,16 +395,16 @@ class foo { template void bar(foo) { /* ... */ } - In this case, the template argument list could be left empty, because - it can be implicitly deduced from the function arguments, but the - angle brackets must be present, otherwise the declaration will be - taken as a non-template function. Furthermore, in some cases, you may - have to explicitly specify the template arguments, to remove + In this case, the template argument list could be left empty, because + it can be implicitly deduced from the function arguments, but the + angle brackets must be present, otherwise the declaration will be + taken as a non-template function. Furthermore, in some cases, you may + have to explicitly specify the template arguments, to remove ambiguity. An error in the last public comment draft of the ANSI/ISO C++ Standard - and the fact that previous releases of GCC would accept such friend - declarations as template declarations has led people to believe that + and the fact that previous releases of GCC would accept such friend + declarations as template declarations has led people to believe that the forward declaration was not necessary, but, according to the final version of the Standard, it is. _________________________________________________________________ @@ -414,77 +413,75 @@ dynamic_cast, throw, typeid don't work with shared libraries The new C++ ABI in the GCC 3.0 series uses address comparisons, rather than string compares, to determine type equality. This leads to better - performance. Like other objects that have to be present in the final - executable, these std::type_info objects have what is called vague - linkage because they are not tightly bound to any one particular - translation unit (object file). The compiler has to emit them in any - translation unit that requires their presence, and then rely on the - linking and loading process to make sure that only one of them is - active in the final executable. With static linking all of these - symbols are resolved at link time, but with dynamic linking, further + performance. Like other objects that have to be present in the final + executable, these std::type_info objects have what is called vague + linkage because they are not tightly bound to any one particular + translation unit (object file). The compiler has to emit them in any + translation unit that requires their presence, and then rely on the + linking and loading process to make sure that only one of them is + active in the final executable. With static linking all of these + symbols are resolved at link time, but with dynamic linking, further resolution occurs at load time. You have to ensure that objects within - a shared library are resolved against objects in the executable and + a shared library are resolved against objects in the executable and other shared libraries. - * For a program which is linked against a shared library, no + * For a program which is linked against a shared library, no additional precautions are needed. - * You cannot create a shared library with the "-Bsymbolic" option, + * You cannot create a shared library with the "-Bsymbolic" option, as that prevents the resolution described above. - * If you use dlopen to explicitly load code from a shared library, - you must do several things. First, export global symbols from the - executable by linking it with the "-E" flag (you will have to - specify this as "-Wl,-E" if you are invoking the linker in the - usual manner from the compiler driver, g++). You must also make - the external symbols in the loaded library available for - subsequent libraries by providing the RTLD_GLOBAL flag to dlopen. + * If you use dlopen to explicitly load code from a shared library, + you must do several things. First, export global symbols from the + executable by linking it with the "-E" flag (you will have to + specify this as "-Wl,-E" if you are invoking the linker in the + usual manner from the compiler driver, g++). You must also make + the external symbols in the loaded library available for + subsequent libraries by providing the RTLD_GLOBAL flag to dlopen. The symbol resolution can be immediate or lazy. - Template instantiations are another, user visible, case of objects + Template instantiations are another, user visible, case of objects with vague linkage, which needs similar resolution. If you do not take - the above precautions, you may discover that a template instantiation - with the same argument list, but instantiated in multiple translation - units, has several addresses, depending in which translation unit the - address is taken. (This is not an exhaustive list of the kind of - objects which have vague linkage and are expected to be resolved + the above precautions, you may discover that a template instantiation + with the same argument list, but instantiated in multiple translation + units, has several addresses, depending in which translation unit the + address is taken. (This is not an exhaustive list of the kind of + objects which have vague linkage and are expected to be resolved during linking & loading.) - If you are worried about different objects with the same name - colliding during the linking or loading process, then you should use - namespaces to disambiguate them. Giving distinct objects with global - linkage the same name is a violation of the One Definition Rule (ODR) + If you are worried about different objects with the same name + colliding during the linking or loading process, then you should use + namespaces to disambiguate them. Giving distinct objects with global + linkage the same name is a violation of the One Definition Rule (ODR) [basic.def.odr]. For more details about the way that GCC implements these and other C++ - features, please read the [40]ABI specification. Note the - std::type_info objects which must be resolved all begin with "_ZTS". - Refer to ld's documentation for a description of the "-E" & + features, please read the [40]ABI specification. Note the + std::type_info objects which must be resolved all begin with "_ZTS". + Refer to ld's documentation for a description of the "-E" & "-Bsymbolic" flags. _________________________________________________________________ Why do I need autoconf, bison, xgettext, automake, etc? - If you're using diffs up dated from one snapshot to the next, or if - you're using the CVS repository, you may need several additional + If you're using diffs up dated from one snapshot to the next, or if + you're using the SVN repository, you may need several additional programs to build GCC. - These include, but are not necessarily limited to autoconf, automake, + These include, but are not necessarily limited to autoconf, automake, bison, and xgettext. - This is necessary because neither diff nor cvs keep timestamps - correct. This causes problems for generated files as "make" may think + This is necessary because neither diff nor cvs keep timestamps + correct. This causes problems for generated files as "make" may think those generated files are out of date and try to regenerate them. - An easy way to work around this problem is to use the gcc_update - script in the contrib subdirectory of GCC, which handles this - transparently without requiring installation of any additional tools. - (Note: Up to and including GCC 2.95 this script was called egcs_update - .) + An easy way to work around this problem is to use the gcc_update + script in the contrib subdirectory of GCC, which handles this + transparently without requiring installation of any additional tools. - When building from diffs or CVS or if you modified some sources, you + When building from diffs or SVN or if you modified some sources, you may also need to obtain development versions of some GNU tools, as the - production versions do not necessarily handle all features needed to + production versions do not necessarily handle all features needed to rebuild GCC. - In general, the current versions of these tools from + In general, the current versions of these tools from [41]ftp://ftp.gnu.org/gnu/ will work. At present, Autoconf 2.50 is not supported, and you will need to use Autoconf 2.13; work is in progress to fix this problem. Also look at @@ -494,20 +491,20 @@ Why do I need autoconf, bison, xgettext, automake, etc? Why can't I build a shared library? - When building a shared library you may get an error message from the + When building a shared library you may get an error message from the linker like `assert pure-text failed:' or `DP relative code in file'. - This kind of error occurs when you've failed to provide proper flags + This kind of error occurs when you've failed to provide proper flags to gcc when linking the shared library. You can get this error even if all the .o files for the shared library - were compiled with the proper PIC option. When building a shared - library, gcc will compile additional code to be included in the - library. That additional code must also be compiled with the proper + were compiled with the proper PIC option. When building a shared + library, gcc will compile additional code to be included in the + library. That additional code must also be compiled with the proper PIC option. - Adding the proper PIC option (-fpic or -fPIC) to the link line which - creates the shared library will fix this problem on targets that + Adding the proper PIC option (-fpic or -fPIC) to the link line which + creates the shared library will fix this problem on targets that support PIC in this manner. For example: gcc -c -fPIC myfile.c gcc -shared -o libmyfile.so -fPIC myfile.o @@ -516,36 +513,36 @@ Why can't I build a shared library? When building C++, the linker says my constructors, destructors or virtual tables are undefined, but I defined them - The ISO C++ Standard specifies that all virtual methods of a class - that are not pure-virtual must be defined, but does not require any - diagnostic for violations of this rule [class.virtual]/8. Based on - this assumption, GCC will only emit the implicitly defined - constructors, the assignment operator, the destructor and the virtual - table of a class in the translation unit that defines its first such + The ISO C++ Standard specifies that all virtual methods of a class + that are not pure-virtual must be defined, but does not require any + diagnostic for violations of this rule [class.virtual]/8. Based on + this assumption, GCC will only emit the implicitly defined + constructors, the assignment operator, the destructor and the virtual + table of a class in the translation unit that defines its first such non-inline method. - Therefore, if you fail to define this particular method, the linker - may complain about the lack of definitions for apparently unrelated - symbols. Unfortunately, in order to improve this error message, it - might be necessary to change the linker, and this can't always be + Therefore, if you fail to define this particular method, the linker + may complain about the lack of definitions for apparently unrelated + symbols. Unfortunately, in order to improve this error message, it + might be necessary to change the linker, and this can't always be done. - The solution is to ensure that all virtual methods that are not pure - are defined. Note that a destructor must be defined even if it is + The solution is to ensure that all virtual methods that are not pure + are defined. Note that a destructor must be defined even if it is declared pure-virtual [class.dtor]/7. _________________________________________________________________ Will GCC someday include an incremental linker? - Incremental linking is part of the linker, not the compiler. As such, + Incremental linking is part of the linker, not the compiler. As such, GCC doesn't have anything to do with incremental linking. Depending on - what platform you use, it may be possible to tell GCC to use the + what platform you use, it may be possible to tell GCC to use the platform's native linker (e.g., Solaris' ild(1)). References 1. http://gcc.gnu.org/faq.html - 2. http://www.eskimo.com/~scs/C-faq/top.html + 2. http://c-faq.com/ 3. http://www.jamesd.demon.co.uk/csc/faq.html 4. http://www.fortran.com/fortran/info.html 5. http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html diff --git a/contrib/gcc-3.4/LAST_UPDATED b/contrib/gcc-3.4/LAST_UPDATED index fdda403036..bdac6660c9 100644 --- a/contrib/gcc-3.4/LAST_UPDATED +++ b/contrib/gcc-3.4/LAST_UPDATED @@ -1 +1 @@ -Obtained from CVS: -rgcc-ss-3_4-20050809 +Obtained from SVN: tags/gcc_3_4_6_release revision 111785 diff --git a/contrib/gcc-3.4/README.DELETED b/contrib/gcc-3.4/README.DELETED index fa425be95f..90fb93a4bf 100644 --- a/contrib/gcc-3.4/README.DELETED +++ b/contrib/gcc-3.4/README.DELETED @@ -1,517 +1,512 @@ -./.cvsignore -./ABOUT-NLS -./ChangeLog -./INSTALL -./MD5SUMS -./NEWS -./Makefile.def -./Makefile.in -./Makefile.tpl -./bugs.html -./config -./config-ml.in -./config.guess -./config.if -./config.rpath -./config.sub -./configure -./configure.in -./contrib -./faq.html -./gcc/.cvsignore -./gcc/ABOUT-GCC-NLS -./gcc/ChangeLog -./gcc/ChangeLog.0 -./gcc/ChangeLog.1 -./gcc/ChangeLog.10 -./gcc/ChangeLog.2 -./gcc/ChangeLog.3 -./gcc/ChangeLog.4 -./gcc/ChangeLog.5 -./gcc/ChangeLog.6 -./gcc/ChangeLog.7 -./gcc/ChangeLog.8 -./gcc/ChangeLog.9 -./gcc/ChangeLog.lib -./gcc/FSFChangeLog -./gcc/FSFChangeLog.10 -./gcc/FSFChangeLog.11 -./gcc/LANGUAGES -./gcc/Makefile.in -./gcc/ONEWS -./gcc/README-fixinc -./gcc/README.Portability -./gcc/aclocal.m4 -./gcc/c-config-lang.in -./gcc/c-parse.c -./gcc/c-parse.y -./gcc/config.build -./gcc/config.gcc -./gcc/config.host -./gcc/config.in -./gcc/config/alpha -./gcc/config/arc -./gcc/config/arm -./gcc/config/avr -./gcc/config/c4x -./gcc/config/chorus.h -./gcc/config/cris -./gcc/config/d30v -./gcc/config/darwin-c.c -./gcc/config/darwin-crt2.c -./gcc/config/darwin-protos.h -./gcc/config/darwin.c -./gcc/config/darwin.h -./gcc/config/dbx.h -./gcc/config/dbxcoff.h -./gcc/config/divmod.c -./gcc/config/dsp16xx -./gcc/config/fp-bit.c -./gcc/config/fp-bit.h -./gcc/config/fr30 -./gcc/config/freebsd-nthr.h -./gcc/config/freebsd-spec.h -./gcc/config/freebsd.h -./gcc/config/frv -./gcc/config/gnu.h -./gcc/config/gofast.h -./gcc/config/h8300 -./gcc/config/host-linux.c -./gcc/config/host-solaris.c -./gcc/config/i370 -./gcc/config/i386/beos-elf.h -./gcc/config/i386/crtdll.h -./gcc/config/i386/cygming.h -./gcc/config/i386/cygwin.asm -./gcc/config/i386/cygwin.h -./gcc/config/i386/cygwin1.c -./gcc/config/i386/cygwin2.c -./gcc/config/i386/darwin.h -./gcc/config/i386/djgpp.h -./gcc/config/i386/freebsd-aout.h -./gcc/config/i386/freebsd.h -./gcc/config/i386/freebsd64.h -./gcc/config/i386/gmon-sol2.c -./gcc/config/i386/gnu.h -./gcc/config/i386/gstabs.h -./gcc/config/i386/gthr-win32.c -./gcc/config/i386/i386-aout.h -./gcc/config/i386/i386-coff.h -./gcc/config/i386/i386-interix.h -./gcc/config/i386/i386-interix3.h -./gcc/config/i386/kaos-i386.h -./gcc/config/i386/kfreebsdgnu.h -./gcc/config/i386/libgcc-x86_64-glibc.ver -./gcc/config/i386/linux-aout.h -./gcc/config/i386/linux.h -./gcc/config/i386/linux64.h -./gcc/config/i386/lynx-ng.h -./gcc/config/i386/lynx.h -./gcc/config/i386/mach.h -./gcc/config/i386/mingw32.h -./gcc/config/i386/moss.h -./gcc/config/i386/netbsd-elf.h -./gcc/config/i386/netbsd.h -./gcc/config/i386/netbsd64.h -./gcc/config/i386/netware.h -./gcc/config/i386/nto.h -./gcc/config/i386/openbsd.h -./gcc/config/i386/ptx4-i.h -./gcc/config/i386/rtemself.h -./gcc/config/i386/sco5.h -./gcc/config/i386/sol2-c1.asm -./gcc/config/i386/sol2-ci.asm -./gcc/config/i386/sol2-cn.asm -./gcc/config/i386/sol2-gc1.asm -./gcc/config/i386/sol2.h -./gcc/config/i386/svr3.ifile -./gcc/config/i386/svr3dbx.h -./gcc/config/i386/svr3gas.h -./gcc/config/i386/svr3z.ifile -./gcc/config/i386/sysv3.h -./gcc/config/i386/sysv4-cpp.h -./gcc/config/i386/sysv4.h -./gcc/config/i386/sysv5.h -./gcc/config/i386/t-beos -./gcc/config/i386/t-crtpic -./gcc/config/i386/t-crtstuff -./gcc/config/i386/t-cygming -./gcc/config/i386/t-cygwin -./gcc/config/i386/t-djgpp -./gcc/config/i386/t-i386elf -./gcc/config/i386/t-interix -./gcc/config/i386/t-linux64 -./gcc/config/i386/t-mingw32 -./gcc/config/i386/t-nto -./gcc/config/i386/t-openbsd -./gcc/config/i386/t-rtems-i386 -./gcc/config/i386/t-sco5 -./gcc/config/i386/t-sol2 -./gcc/config/i386/t-svr3dbx -./gcc/config/i386/t-udk -./gcc/config/i386/t-uwin -./gcc/config/i386/t-vxworks -./gcc/config/i386/udk.h -./gcc/config/i386/uwin.asm -./gcc/config/i386/uwin.h -./gcc/config/i386/vsta.h -./gcc/config/i386/vxworks.h -./gcc/config/i386/winnt.c -./gcc/config/i386/x-mingw32 -./gcc/config/i386/xm-cygwin.h -./gcc/config/i386/xm-djgpp.h -./gcc/config/i386/xm-mingw32.h -./gcc/config/i860 -./gcc/config/i960 -./gcc/config/ia64 -./gcc/config/interix.h -./gcc/config/interix3.h -./gcc/config/ip2k -./gcc/config/iq2000 -./gcc/config/kaos.h -./gcc/config/kfreebsdgnu.h -./gcc/config/libgcc-glibc.ver -./gcc/config/libgloss.h -./gcc/config/linux-aout.h -./gcc/config/linux.h -./gcc/config/lynx-ng.h -./gcc/config/lynx.h -./gcc/config/m32r -./gcc/config/m68hc11 -./gcc/config/m68k -./gcc/config/mcore -./gcc/config/mips -./gcc/config/mmix -./gcc/config/mn10300 -./gcc/config/netbsd-aout.h -./gcc/config/netbsd-elf.h -./gcc/config/netbsd.h -./gcc/config/netware.h -./gcc/config/ns32k -./gcc/config/openbsd-oldgas.h -./gcc/config/openbsd.h -./gcc/config/pa -./gcc/config/pdp11 -./gcc/config/ptx4.h -./gcc/config/rs6000 -./gcc/config/rtems.h -./gcc/config/s390 -./gcc/config/sh -./gcc/config/sol2.h -./gcc/config/sparc -./gcc/config/stormy16 -./gcc/config/svr3.h -./gcc/config/svr4.h -./gcc/config/t-darwin -./gcc/config/t-freebsd -./gcc/config/t-freebsd-thread -./gcc/config/t-gnu -./gcc/config/t-kfreebsd-gnu -./gcc/config/t-libc-ok -./gcc/config/t-libgcc-pic -./gcc/config/t-libunwind -./gcc/config/t-libunwind-elf -./gcc/config/t-linux -./gcc/config/t-linux-gnulibc1 -./gcc/config/t-netbsd -./gcc/config/t-openbsd -./gcc/config/t-openbsd-thread -./gcc/config/t-rtems -./gcc/config/t-slibgcc-darwin -./gcc/config/t-slibgcc-elf-ver -./gcc/config/t-slibgcc-nolc-override -./gcc/config/t-slibgcc-sld -./gcc/config/t-svr4 -./gcc/config/t-vxworks -./gcc/config/tm-dwarf2.h -./gcc/config/udivmod.c -./gcc/config/udivmodsi4.c -./gcc/config/usegas.h -./gcc/config/v850 -./gcc/config/vax -./gcc/config/vxlib.c -./gcc/config/vxworks.h -./gcc/config/windiss.h -./gcc/config/x-interix -./gcc/config/x-linux -./gcc/config/x-solaris -./gcc/config/xtensa -./gcc/configure -./gcc/configure.ac -./gcc/cp/ChangeLog -./gcc/cp/ChangeLog.1 -./gcc/cp/ChangeLog.2 -./gcc/cp/ChangeLog.3 -./gcc/cp/ChangeLog.egcs -./gcc/cp/Make-lang.in -./gcc/cp/NEWS -./gcc/cp/config-lang.in -./gcc/cppucnid.pl -./gcc/cppucnid.tab -./gcc/cstamp-h.in -./gcc/doc/install.texi2html -./gcc/doc/cpp.1 -./gcc/doc/cpp.info -./gcc/doc/cppinternals.info -./gcc/doc/fsf-funding.7 -./gcc/doc/g++.1 -./gcc/doc/g77.1 -./gcc/doc/g77.info -./gcc/doc/gcc.1 -./gcc/doc/gcc.info -./gcc/doc/gccinstall.info -./gcc/doc/gccint.info -./gcc/doc/gcj.1 -./gcc/doc/gcj.info -./gcc/doc/gcjh.1 -./gcc/doc/gcov.1 -./gcc/doc/gfdl.7 -./gcc/doc/gij.1 -./gcc/doc/gpl.7 -./gcc/doc/jcf-dump.1 -./gcc/doc/jv-convert.1 -./gcc/doc/jv-scan.1 -./gcc/doc/rmic.1 -./gcc/doc/rmiregistry.1 -./gcc/f/BUGS -./gcc/f/ChangeLog -./gcc/f/ChangeLog.0 -./gcc/f/Make-lang.in -./gcc/f/NEWS -./gcc/f/RELEASE-PREP -./gcc/f/config-lang.in -./gcc/fixinc -./gcc/fixproto -./gcc/gccbug.in -./gcc/gdbinit.in -./gcc/gengtype-lex.c -./gcc/gengtype-yacc.c -./gcc/gengtype-yacc.h -./gcc/ginclude -./gcc/libgcc-darwin.ver -./gcc/libgcc-std.ver -./gcc/mkconfig.sh -./gcc/mkheaders.in -./gcc/mkinstalldirs -./gcc/mklibgcc.in -./gcc/mkmap-flat.awk -./gcc/mkmap-symver.awk -./gcc/move-if-change -./gcc/objc/Make-lang.in -./gcc/objc/config-lang.in -./gcc/objc/objc-parse.c -./gcc/objc/objc-parse.y -./gcc/po -./gcc/scan-types.sh -./gcc/sort-protos -./gcc/treelang -./gcc/unwind-compat.c -./gcc/unwind-compat.h -./gcc/unwind-dw2-fde-compat.c -./include/ChangeLog -./include/floatformat.h -./include/fnmatch.h -./include/getopt.h -./include/sort.h -./include/symcat.h -./include/ternary.h -./include/xregex.h -./include/xregex2.h -./include/xtensa-config.h -./install-sh -./intl -./libf2c/Makefile.in -./libf2c/aclocal.m4 -./libf2c/configure -./libf2c/configure.in -./libf2c/libF77/Makefile.in -./libf2c/libF77/configure -./libf2c/libF77/configure.in -./libf2c/libF77/dtime_.c -./libf2c/libF77/etime_.c -./libf2c/libF77/f2ch.add -./libf2c/libF77/makefile.netlib -./libf2c/libI77/Makefile.in -./libf2c/libI77/config.h.in -./libf2c/libI77/configure -./libf2c/libI77/configure.in -./libf2c/libI77/f2ch.add -./libf2c/libI77/makefile.netlib -./libf2c/libI77/stamp-h.in -./libf2c/libU77/Makefile.in -./libf2c/libU77/acconfig.h -./libf2c/libU77/aclocal.m4 -./libf2c/libU77/config.hin -./libf2c/libU77/configure -./libf2c/libU77/configure.in -./libf2c/libU77/stamp-h.in -./libf2c/libU77/u77-test.f -./libiberty/Makefile.in -./libiberty/_doprnt.c -./libiberty/acconfig.h -./libiberty/aclocal.m4 -./libiberty/alloca.c -./libiberty/argv.c -./libiberty/asprintf.c -./libiberty/atexit.c -./libiberty/basename.c -./libiberty/bcmp.c -./libiberty/bcopy.c -./libiberty/bsearch.c -./libiberty/bzero.c -./libiberty/calloc.c -./libiberty/clock.c -./libiberty/config -./libiberty/config.h-vms -./libiberty/config.in -./libiberty/config.table -./libiberty/configure -./libiberty/configure.ac -./libiberty/copying-lib.texi -./libiberty/copysign.c -./libiberty/cp-demint.c -./libiberty/fdmatch.c -./libiberty/ffs.c -./libiberty/floatformat.c -./libiberty/fnmatch.c -./libiberty/fnmatch.txh -./libiberty/functions.texi -./libiberty/gather-docs -./libiberty/getcwd.c -./libiberty/getopt.c -./libiberty/getopt1.c -./libiberty/getpagesize.c -./libiberty/index.c -./libiberty/libiberty.texi -./libiberty/maint-tool -./libiberty/makefile.vms -./libiberty/memchr.c -./libiberty/memcmp.c -./libiberty/memcpy.c -./libiberty/memmove.c -./libiberty/mempcpy.c -./libiberty/memset.c -./libiberty/mkstemps.c -./libiberty/mpw-config.in -./libiberty/mpw-make.sed -./libiberty/mpw.c -./libiberty/msdos.c -./libiberty/partition.c -./libiberty/pex-djgpp.c -./libiberty/pex-mpw.c -./libiberty/pex-msdos.c -./libiberty/pex-os2.c -./libiberty/pex-win32.c -./libiberty/pexecute.txh -./libiberty/putenv.c -./libiberty/random.c -./libiberty/regex.c -./libiberty/rename.c -./libiberty/rindex.c -./libiberty/setenv.c -./libiberty/sigsetmask.c -./libiberty/snprintf.c -./libiberty/sort.c -./libiberty/spaces.c -./libiberty/stpcpy.c -./libiberty/stpncpy.c -./libiberty/strcasecmp.c -./libiberty/strchr.c -./libiberty/strdup.c -./libiberty/strerror.c -./libiberty/strncasecmp.c -./libiberty/strncmp.c -./libiberty/strrchr.c -./libiberty/strsignal.c -./libiberty/strstr.c -./libiberty/strtod.c -./libiberty/strtol.c -./libiberty/strtoul.c -./libiberty/ternary.c -./libiberty/testsuite -./libiberty/tmpnam.c -./libiberty/vasprintf.c -./libiberty/vfork.c -./libiberty/vfprintf.c -./libiberty/vmsbuild.com -./libiberty/vprintf.c -./libiberty/vsnprintf.c -./libiberty/vsprintf.c -./libiberty/waitpid.c -./libobjc/Makefile.in -./libobjc/aclocal.m4 -./libobjc/config.h.in -./libobjc/configure -./libobjc/configure.in -./libobjc/makefile.dos -./libobjc/thr-decosf1.c -./libobjc/thr-irix.c -./libobjc/thr-mach.c -./libobjc/thr-os2.c -./libobjc/thr-rtems.c -./libobjc/thr-solaris.c -./libobjc/thr-vxworks.c -./libobjc/thr-win32.c -./libstdc++-v3/.cvsignore -./libstdc++-v3/ChangeLog-2004 -./libstdc++-v3/Makefile.am -./libstdc++-v3/Makefile.in -./libstdc++-v3/acconfig.h -./libstdc++-v3/acinclude.m4 -./libstdc++-v3/aclocal.m4 -./libstdc++-v3/config.h.in -./libstdc++-v3/config/abi -./libstdc++-v3/config/cpu/alpha -./libstdc++-v3/config/cpu/cris -./libstdc++-v3/config/cpu/hppa -./libstdc++-v3/config/cpu/ia64 -./libstdc++-v3/config/cpu/m68k -./libstdc++-v3/config/cpu/mips -./libstdc++-v3/config/cpu/powerpc -./libstdc++-v3/config/cpu/s390 -./libstdc++-v3/config/cpu/sparc -./libstdc++-v3/config/locale/gnu -./libstdc++-v3/config/os/aix -./libstdc++-v3/config/os/bsd/freebsd -./libstdc++-v3/config/os/djgpp -./libstdc++-v3/config/os/gnu-linux -./libstdc++-v3/config/os/hpux -./libstdc++-v3/config/os/irix -./libstdc++-v3/config/os/mingw32 -./libstdc++-v3/config/os/newlib -./libstdc++-v3/config/os/qnx -./libstdc++-v3/config/os/solaris -./libstdc++-v3/config/os/tpf -./libstdc++-v3/config/os/vxworks -./libstdc++-v3/config/os/windiss -./libstdc++-v3/configure -./libstdc++-v3/configure.ac -./libstdc++-v3/configure.host -./libstdc++-v3/crossconfig.m4 -./libstdc++-v3/docs -./libstdc++-v3/fragment.am -./libstdc++-v3/include/Makefile.am -./libstdc++-v3/include/Makefile.in -./libstdc++-v3/libmath/Makefile.am -./libstdc++-v3/libmath/Makefile.in -./libstdc++-v3/libsupc++/Makefile.am -./libstdc++-v3/libsupc++/Makefile.in -./libstdc++-v3/linkage.m4 -./libstdc++-v3/po -./libstdc++-v3/scripts -./libstdc++-v3/src/Makefile.am -./libstdc++-v3/src/Makefile.in -./libstdc++-v3/testsuite -./libtool.m4 -./ltcf-c.sh -./ltcf-cxx.sh -./ltcf-gcj.sh -./ltconfig -./ltmain.sh -./maintainer-scripts -./missing -./mkdep -./mkinstalldirs -./move-if-change -./symlink-tree -./ylwrap +.cvsignore +ABOUT-NLS +ChangeLog +INSTALL/ +MD5SUMS +Makefile.def +Makefile.in +Makefile.tpl +NEWS +bugs.html +config/ +config-ml.in +config.guess +config.if +config.rpath +config.sub +configure +configure.in +contrib/ +faq.html +gcc/.cvsignore +gcc/ABOUT-GCC-NLS +gcc/ChangeLog +gcc/ChangeLog.0 +gcc/ChangeLog.1 +gcc/ChangeLog.10 +gcc/ChangeLog.2 +gcc/ChangeLog.3 +gcc/ChangeLog.4 +gcc/ChangeLog.5 +gcc/ChangeLog.6 +gcc/ChangeLog.7 +gcc/ChangeLog.8 +gcc/ChangeLog.9 +gcc/ChangeLog.lib +gcc/FSFChangeLog +gcc/FSFChangeLog.10 +gcc/FSFChangeLog.11 +gcc/LANGUAGES +gcc/Makefile.in +gcc/ONEWS +gcc/README-fixinc +gcc/README.Portability +gcc/aclocal.m4 +gcc/c-config-lang.in +gcc/c-parse.c +gcc/c-parse.y +gcc/config/alpha/ +gcc/config/arc/ +gcc/config/arm/ +gcc/config/avr/ +gcc/config/c4x/ +gcc/config/chorus.h +gcc/config/cris/ +gcc/config/d30v/ +gcc/config/darwin-c.c +gcc/config/darwin-crt2.c +gcc/config/darwin-protos.h +gcc/config/darwin.c +gcc/config/darwin.h +gcc/config/dbx.h +gcc/config/dbxcoff.h +gcc/config/divmod.c +gcc/config/dsp16xx/ +gcc/config/fp-bit.c +gcc/config/fp-bit.h +gcc/config/fr30/ +gcc/config/freebsd-nthr.h +gcc/config/freebsd-spec.h +gcc/config/freebsd.h +gcc/config/frv/ +gcc/config/gnu.h +gcc/config/gofast.h +gcc/config/h8300/ +gcc/config/host-linux.c +gcc/config/host-solaris.c +gcc/config/i370/ +gcc/config/i386/beos-elf.h +gcc/config/i386/crtdll.h +gcc/config/i386/cygming.h +gcc/config/i386/cygwin.asm +gcc/config/i386/cygwin.h +gcc/config/i386/cygwin1.c +gcc/config/i386/cygwin2.c +gcc/config/i386/darwin.h +gcc/config/i386/djgpp.h +gcc/config/i386/freebsd-aout.h +gcc/config/i386/freebsd.h +gcc/config/i386/freebsd64.h +gcc/config/i386/gmon-sol2.c +gcc/config/i386/gnu.h +gcc/config/i386/gstabs.h +gcc/config/i386/gthr-win32.c +gcc/config/i386/i386-aout.h +gcc/config/i386/i386-coff.h +gcc/config/i386/i386-interix.h +gcc/config/i386/i386-interix3.h +gcc/config/i386/kaos-i386.h +gcc/config/i386/kfreebsdgnu.h +gcc/config/i386/libgcc-x86_64-glibc.ver +gcc/config/i386/linux-aout.h +gcc/config/i386/linux.h +gcc/config/i386/linux64.h +gcc/config/i386/lynx-ng.h +gcc/config/i386/lynx.h +gcc/config/i386/mach.h +gcc/config/i386/mingw32.h +gcc/config/i386/moss.h +gcc/config/i386/netbsd-elf.h +gcc/config/i386/netbsd.h +gcc/config/i386/netbsd64.h +gcc/config/i386/netware.h +gcc/config/i386/nto.h +gcc/config/i386/openbsd.h +gcc/config/i386/ptx4-i.h +gcc/config/i386/rtemself.h +gcc/config/i386/sco5.h +gcc/config/i386/sol2-c1.asm +gcc/config/i386/sol2-ci.asm +gcc/config/i386/sol2-cn.asm +gcc/config/i386/sol2-gc1.asm +gcc/config/i386/sol2.h +gcc/config/i386/svr3.ifile +gcc/config/i386/svr3dbx.h +gcc/config/i386/svr3gas.h +gcc/config/i386/svr3z.ifile +gcc/config/i386/sysv3.h +gcc/config/i386/sysv4-cpp.h +gcc/config/i386/sysv4.h +gcc/config/i386/sysv5.h +gcc/config/i386/t-beos +gcc/config/i386/t-crtpic +gcc/config/i386/t-crtstuff +gcc/config/i386/t-cygming +gcc/config/i386/t-cygwin +gcc/config/i386/t-djgpp +gcc/config/i386/t-i386elf +gcc/config/i386/t-interix +gcc/config/i386/t-linux64 +gcc/config/i386/t-mingw32 +gcc/config/i386/t-nto +gcc/config/i386/t-openbsd +gcc/config/i386/t-rtems-i386 +gcc/config/i386/t-sco5 +gcc/config/i386/t-sol2 +gcc/config/i386/t-svr3dbx +gcc/config/i386/t-udk +gcc/config/i386/t-uwin +gcc/config/i386/t-vxworks +gcc/config/i386/udk.h +gcc/config/i386/uwin.asm +gcc/config/i386/uwin.h +gcc/config/i386/vsta.h +gcc/config/i386/vxworks.h +gcc/config/i386/winnt.c +gcc/config/i386/x-mingw32 +gcc/config/i386/xm-cygwin.h +gcc/config/i386/xm-djgpp.h +gcc/config/i386/xm-mingw32.h +gcc/config/i860/ +gcc/config/i960/ +gcc/config/ia64/ +gcc/config/interix.h +gcc/config/interix3.h +gcc/config/ip2k/ +gcc/config/iq2000/ +gcc/config/kaos.h +gcc/config/kfreebsdgnu.h +gcc/config/libgcc-glibc.ver +gcc/config/libgloss.h +gcc/config/linux-aout.h +gcc/config/linux.h +gcc/config/lynx-ng.h +gcc/config/lynx.h +gcc/config/m32r/ +gcc/config/m68hc11/ +gcc/config/m68k/ +gcc/config/mcore/ +gcc/config/mips/ +gcc/config/mmix/ +gcc/config/mn10300/ +gcc/config/netbsd-aout.h +gcc/config/netbsd-elf.h +gcc/config/netbsd.h +gcc/config/netware.h +gcc/config/ns32k/ +gcc/config/openbsd-oldgas.h +gcc/config/openbsd.h +gcc/config/pa/ +gcc/config/pdp11/ +gcc/config/ptx4.h +gcc/config/rs6000/ +gcc/config/rtems.h +gcc/config/s390/ +gcc/config/sh/ +gcc/config/sol2.h +gcc/config/sparc/ +gcc/config/stormy16/ +gcc/config/svr3.h +gcc/config/svr4.h +gcc/config/t-darwin +gcc/config/t-freebsd +gcc/config/t-freebsd-thread +gcc/config/t-gnu +gcc/config/t-kfreebsd-gnu +gcc/config/t-libc-ok +gcc/config/t-libgcc-pic +gcc/config/t-libunwind +gcc/config/t-libunwind-elf +gcc/config/t-linux +gcc/config/t-linux-gnulibc1 +gcc/config/t-netbsd +gcc/config/t-openbsd +gcc/config/t-openbsd-thread +gcc/config/t-rtems +gcc/config/t-slibgcc-darwin +gcc/config/t-slibgcc-elf-ver +gcc/config/t-slibgcc-nolc-override +gcc/config/t-slibgcc-sld +gcc/config/t-svr4 +gcc/config/t-vxworks +gcc/config/tm-dwarf2.h +gcc/config/udivmod.c +gcc/config/udivmodsi4.c +gcc/config/usegas.h +gcc/config/v850/ +gcc/config/vax/ +gcc/config/vxlib.c +gcc/config/vxworks.h +gcc/config/windiss.h +gcc/config/x-interix +gcc/config/x-linux +gcc/config/x-solaris +gcc/config/xtensa/ +gcc/config.build +gcc/config.gcc +gcc/config.host +gcc/config.in +gcc/configure +gcc/configure.ac +gcc/cp/ChangeLog +gcc/cp/ChangeLog.1 +gcc/cp/ChangeLog.2 +gcc/cp/ChangeLog.3 +gcc/cp/ChangeLog.egcs +gcc/cp/Make-lang.in +gcc/cp/NEWS +gcc/cp/config-lang.in +gcc/cppucnid.pl +gcc/cppucnid.tab +gcc/cstamp-h.in +gcc/doc/cpp.info +gcc/doc/cppinternals.info +gcc/doc/fsf-funding.7 +gcc/doc/g77.info +gcc/doc/gcc.info +gcc/doc/gccinstall.info +gcc/doc/gccint.info +gcc/doc/gcj.1 +gcc/doc/gcj.info +gcc/doc/gcjh.1 +gcc/doc/gfdl.7 +gcc/doc/gij.1 +gcc/doc/gpl.7 +gcc/doc/install.texi2html +gcc/doc/jcf-dump.1 +gcc/doc/jv-convert.1 +gcc/doc/jv-scan.1 +gcc/doc/rmic.1 +gcc/doc/rmiregistry.1 +gcc/f/BUGS +gcc/f/ChangeLog +gcc/f/ChangeLog.0 +gcc/f/Make-lang.in +gcc/f/NEWS +gcc/f/RELEASE-PREP +gcc/f/config-lang.in +gcc/fixinc/ +gcc/fixproto +gcc/gccbug.in +gcc/gdbinit.in +gcc/gengtype-lex.c +gcc/gengtype-yacc.c +gcc/gengtype-yacc.h +gcc/ginclude/ +gcc/libgcc-darwin.ver +gcc/libgcc-std.ver +gcc/mkconfig.sh +gcc/mkheaders.in +gcc/mkinstalldirs +gcc/mklibgcc.in +gcc/mkmap-flat.awk +gcc/mkmap-symver.awk +gcc/move-if-change +gcc/objc/Make-lang.in +gcc/objc/config-lang.in +gcc/objc/objc-parse.c +gcc/objc/objc-parse.y +gcc/po/ +gcc/scan-types.sh +gcc/sort-protos +gcc/treelang/ +gcc/unwind-compat.c +gcc/unwind-compat.h +gcc/unwind-dw2-fde-compat.c +include/ChangeLog +include/floatformat.h +include/fnmatch.h +include/getopt.h +include/sort.h +include/symcat.h +include/ternary.h +include/xregex.h +include/xregex2.h +include/xtensa-config.h +install-sh +intl/ +libf2c/Makefile.in +libf2c/aclocal.m4 +libf2c/configure +libf2c/configure.in +libf2c/libF77/Makefile.in +libf2c/libF77/configure +libf2c/libF77/configure.in +libf2c/libF77/dtime_.c +libf2c/libF77/etime_.c +libf2c/libF77/f2ch.add +libf2c/libF77/makefile.netlib +libf2c/libI77/Makefile.in +libf2c/libI77/config.h.in +libf2c/libI77/configure +libf2c/libI77/configure.in +libf2c/libI77/f2ch.add +libf2c/libI77/makefile.netlib +libf2c/libI77/stamp-h.in +libf2c/libU77/Makefile.in +libf2c/libU77/acconfig.h +libf2c/libU77/aclocal.m4 +libf2c/libU77/config.hin +libf2c/libU77/configure +libf2c/libU77/configure.in +libf2c/libU77/stamp-h.in +libf2c/libU77/u77-test.f +libiberty/Makefile.in +libiberty/_doprnt.c +libiberty/acconfig.h +libiberty/aclocal.m4 +libiberty/alloca.c +libiberty/argv.c +libiberty/asprintf.c +libiberty/atexit.c +libiberty/basename.c +libiberty/bcmp.c +libiberty/bcopy.c +libiberty/bsearch.c +libiberty/bzero.c +libiberty/calloc.c +libiberty/clock.c +libiberty/config/ +libiberty/config.h-vms +libiberty/config.in +libiberty/config.table +libiberty/configure +libiberty/configure.ac +libiberty/copying-lib.texi +libiberty/copysign.c +libiberty/cp-demint.c +libiberty/fdmatch.c +libiberty/ffs.c +libiberty/floatformat.c +libiberty/fnmatch.c +libiberty/fnmatch.txh +libiberty/functions.texi +libiberty/gather-docs +libiberty/getcwd.c +libiberty/getopt.c +libiberty/getopt1.c +libiberty/getpagesize.c +libiberty/index.c +libiberty/libiberty.texi +libiberty/maint-tool +libiberty/makefile.vms +libiberty/memchr.c +libiberty/memcmp.c +libiberty/memcpy.c +libiberty/memmove.c +libiberty/mempcpy.c +libiberty/memset.c +libiberty/mkstemps.c +libiberty/mpw-config.in +libiberty/mpw-make.sed +libiberty/mpw.c +libiberty/msdos.c +libiberty/partition.c +libiberty/pex-djgpp.c +libiberty/pex-mpw.c +libiberty/pex-msdos.c +libiberty/pex-os2.c +libiberty/pex-win32.c +libiberty/pexecute.txh +libiberty/putenv.c +libiberty/random.c +libiberty/regex.c +libiberty/rename.c +libiberty/rindex.c +libiberty/setenv.c +libiberty/sigsetmask.c +libiberty/snprintf.c +libiberty/sort.c +libiberty/spaces.c +libiberty/stpcpy.c +libiberty/stpncpy.c +libiberty/strcasecmp.c +libiberty/strchr.c +libiberty/strdup.c +libiberty/strerror.c +libiberty/strncasecmp.c +libiberty/strncmp.c +libiberty/strrchr.c +libiberty/strsignal.c +libiberty/strstr.c +libiberty/strtod.c +libiberty/strtol.c +libiberty/strtoul.c +libiberty/ternary.c +libiberty/testsuite/ +libiberty/tmpnam.c +libiberty/vasprintf.c +libiberty/vfork.c +libiberty/vfprintf.c +libiberty/vmsbuild.com +libiberty/vprintf.c +libiberty/vsnprintf.c +libiberty/vsprintf.c +libiberty/waitpid.c +libobjc/Makefile.in +libobjc/aclocal.m4 +libobjc/config.h.in +libobjc/configure +libobjc/configure.in +libobjc/makefile.dos +libobjc/thr-decosf1.c +libobjc/thr-irix.c +libobjc/thr-mach.c +libobjc/thr-os2.c +libobjc/thr-rtems.c +libobjc/thr-solaris.c +libobjc/thr-vxworks.c +libobjc/thr-win32.c +libstdc++-v3/.cvsignore +libstdc++-v3/ChangeLog-2004 +libstdc++-v3/Makefile.am +libstdc++-v3/Makefile.in +libstdc++-v3/acconfig.h +libstdc++-v3/acinclude.m4 +libstdc++-v3/aclocal.m4 +libstdc++-v3/config/abi/ +libstdc++-v3/config/cpu/alpha/ +libstdc++-v3/config/cpu/cris/ +libstdc++-v3/config/cpu/hppa/ +libstdc++-v3/config/cpu/ia64/ +libstdc++-v3/config/cpu/m68k/ +libstdc++-v3/config/cpu/mips/ +libstdc++-v3/config/cpu/powerpc/ +libstdc++-v3/config/cpu/s390/ +libstdc++-v3/config/cpu/sparc/ +libstdc++-v3/config/locale/gnu/ +libstdc++-v3/config/os/aix/ +libstdc++-v3/config/os/bsd/freebsd/ +libstdc++-v3/config/os/djgpp/ +libstdc++-v3/config/os/gnu-linux/ +libstdc++-v3/config/os/hpux/ +libstdc++-v3/config/os/irix/ +libstdc++-v3/config/os/mingw32/ +libstdc++-v3/config/os/newlib/ +libstdc++-v3/config/os/qnx/ +libstdc++-v3/config/os/solaris/ +libstdc++-v3/config/os/tpf/ +libstdc++-v3/config/os/vxworks/ +libstdc++-v3/config/os/windiss/ +libstdc++-v3/config.h.in +libstdc++-v3/configure +libstdc++-v3/configure.ac +libstdc++-v3/configure.host +libstdc++-v3/crossconfig.m4 +libstdc++-v3/docs/ +libstdc++-v3/fragment.am +libstdc++-v3/include/Makefile.am +libstdc++-v3/include/Makefile.in +libstdc++-v3/libmath/Makefile.am +libstdc++-v3/libmath/Makefile.in +libstdc++-v3/libsupc++/Makefile.am +libstdc++-v3/libsupc++/Makefile.in +libstdc++-v3/linkage.m4 +libstdc++-v3/po/ +libstdc++-v3/scripts/ +libstdc++-v3/src/Makefile.am +libstdc++-v3/src/Makefile.in +libstdc++-v3/testsuite/ +libtool.m4 +ltcf-c.sh +ltcf-cxx.sh +ltcf-gcj.sh +ltconfig +ltmain.sh +maintainer-scripts/ +missing +mkdep +mkinstalldirs +move-if-change +symlink-tree +ylwrap diff --git a/contrib/gcc-3.4/README.DRAGONFLY b/contrib/gcc-3.4/README.DRAGONFLY index 8e2696f50b..90670c7152 100644 --- a/contrib/gcc-3.4/README.DRAGONFLY +++ b/contrib/gcc-3.4/README.DRAGONFLY @@ -2,7 +2,7 @@ GCC-3.4.5 AS USED BY DRAGONFLY This directory contains a selected set of files from the gnu - gcc-3.4.5 distribution. The entire distribution is 102MB but + gcc-3.4.6 distribution. The entire distribution is 102MB but we really only need around 31MB of it. No files have been moved or modified from their extracted position. @@ -14,14 +14,15 @@ on the distribution. The only additional files added to this directory are README.DRAGONFLY and README.DELETED. - MD5 (gcc-core-3.4-20050809.tar.bz2) = 46a06773120b45f839485d5dde582ede - MD5 (gcc-g++-3.4-20050809.tar.bz2) = 35d07f6c0ab96bd7429071cba200de87 - MD5 (gcc-g77-3.4-20050809.tar.bz2) = 829d1c326e6891681b0140d8f0f1e934 - MD5 (gcc-objc-3.4-20050809.tar.bz2) = 6d5afaa643c7880fe6c106201e1b8d44 + + MD5 (gcc-core-3.4.6.tar.bz2) = 5324ace5145b12afd9ca867af7ec084d + MD5 (gcc-g++-3.4.6.tar.bz2) = ef81fd74bc9fd964120af47243a1360f + MD5 (gcc-g77-3.4.6.tar.bz2) = eb4c248fa10a96e8d9edc9831c75a895 + MD5 (gcc-objc-3.4.6.tar.bz2) = 87453b6e9b32047de11ae933a985155f UPGRADE PROCEDURE: - * download a new gcc-3.4.X dist greater then 3.4.4. + * download a new gcc-3.4.X dist greater then 3.4.6. * extract the archive into this directory, overlaying the existing files. diff --git a/contrib/gcc-3.4/gcc/builtins.c b/contrib/gcc-3.4/gcc/builtins.c index a3e069e4ba..2931684a9a 100644 --- a/contrib/gcc-3.4/gcc/builtins.c +++ b/contrib/gcc-3.4/gcc/builtins.c @@ -4329,14 +4329,15 @@ static rtx expand_builtin_fputs (tree arglist, rtx target, bool unlocked) { tree len, fn; - tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED] + /* If we're using an unlocked function, assume the other unlocked + functions exist explicitly. */ + tree const fn_fputc = unlocked ? built_in_decls[BUILT_IN_FPUTC_UNLOCKED] : implicit_built_in_decls[BUILT_IN_FPUTC]; - tree fn_fwrite = unlocked ? implicit_built_in_decls[BUILT_IN_FWRITE_UNLOCKED] + tree const fn_fwrite = unlocked ? built_in_decls[BUILT_IN_FWRITE_UNLOCKED] : implicit_built_in_decls[BUILT_IN_FWRITE]; - /* If the return value is used, or the replacement _DECL isn't - initialized, don't do the transformation. */ - if (target != const0_rtx || !fn_fputc || !fn_fwrite) + /* If the return value is used, don't do the transformation. */ + if (target != const0_rtx) return 0; /* Verify the arguments in the original call. */ @@ -4397,6 +4398,11 @@ expand_builtin_fputs (tree arglist, rtx target, bool unlocked) abort (); } + /* If the replacement _DECL isn't initialized, don't do the + transformation. */ + if (!fn) + return 0; + return expand_expr (build_function_call_expr (fn, arglist), const0_rtx, VOIDmode, EXPAND_NORMAL); } @@ -4651,11 +4657,12 @@ static rtx expand_builtin_printf (tree arglist, rtx target, enum machine_mode mode, bool unlocked) { - tree fn_putchar = unlocked - ? implicit_built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED] - : implicit_built_in_decls[BUILT_IN_PUTCHAR]; - tree fn_puts = unlocked ? implicit_built_in_decls[BUILT_IN_PUTS_UNLOCKED] - : implicit_built_in_decls[BUILT_IN_PUTS]; + /* If we're using an unlocked function, assume the other unlocked + functions exist explicitly. */ + tree const fn_putchar = unlocked ? built_in_decls[BUILT_IN_PUTCHAR_UNLOCKED] + : implicit_built_in_decls[BUILT_IN_PUTCHAR]; + tree const fn_puts = unlocked ? built_in_decls[BUILT_IN_PUTS_UNLOCKED] + : implicit_built_in_decls[BUILT_IN_PUTS]; const char *fmt_str; tree fn, fmt, arg; @@ -4754,10 +4761,12 @@ static rtx expand_builtin_fprintf (tree arglist, rtx target, enum machine_mode mode, bool unlocked) { - tree fn_fputc = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTC_UNLOCKED] - : implicit_built_in_decls[BUILT_IN_FPUTC]; - tree fn_fputs = unlocked ? implicit_built_in_decls[BUILT_IN_FPUTS_UNLOCKED] - : implicit_built_in_decls[BUILT_IN_FPUTS]; + /* If we're using an unlocked function, assume the other unlocked + functions exist explicitly. */ + tree const fn_fputc = unlocked ? built_in_decls[BUILT_IN_FPUTC_UNLOCKED] + : implicit_built_in_decls[BUILT_IN_FPUTC]; + tree const fn_fputs = unlocked ? built_in_decls[BUILT_IN_FPUTS_UNLOCKED] + : implicit_built_in_decls[BUILT_IN_FPUTS]; const char *fmt_str; tree fn, fmt, fp, arg; diff --git a/contrib/gcc-3.4/gcc/c-common.c b/contrib/gcc-3.4/gcc/c-common.c index d79f200025..30f869a9a0 100644 --- a/contrib/gcc-3.4/gcc/c-common.c +++ b/contrib/gcc-3.4/gcc/c-common.c @@ -1273,6 +1273,18 @@ constant_fits_type_p (tree c, tree type) return !TREE_OVERFLOW (c); } +/* Nonzero if vector types T1 and T2 can be converted to each other + without an explicit cast. */ +int +vector_types_convertible_p (tree t1, tree t2) +{ + return targetm.vector_opaque_p (t1) + || targetm.vector_opaque_p (t2) + || (tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2)) + && INTEGRAL_TYPE_P (TREE_TYPE (t1)) + == INTEGRAL_TYPE_P (TREE_TYPE (t2))); +} + /* Convert EXPR to TYPE, warning about conversion problems with constants. Invoke this function on every expression that is converted implicitly, i.e. because of language rules and not because of an explicit cast. */ diff --git a/contrib/gcc-3.4/gcc/c-common.h b/contrib/gcc-3.4/gcc/c-common.h index 7849730f16..0576a0a3bd 100644 --- a/contrib/gcc-3.4/gcc/c-common.h +++ b/contrib/gcc-3.4/gcc/c-common.h @@ -1261,6 +1261,8 @@ extern tree finish_label_address_expr (tree); different implementations. Used in c-common.c. */ extern tree lookup_label (tree); +extern int vector_types_convertible_p (tree t1, tree t2); + extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *); extern int c_safe_from_p (rtx, tree); diff --git a/contrib/gcc-3.4/gcc/c-decl.c b/contrib/gcc-3.4/gcc/c-decl.c index 38166cc94f..66e0fd7d48 100644 --- a/contrib/gcc-3.4/gcc/c-decl.c +++ b/contrib/gcc-3.4/gcc/c-decl.c @@ -1271,7 +1271,10 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) /* Don't warn about forward parameter decls. */ && !(TREE_CODE (newdecl) == PARM_DECL - && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) + && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) + /* Don't warn about a variable definition following a declaration. */ + && !(TREE_CODE (newdecl) == VAR_DECL + && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) { warning ("%Jredundant redeclaration of '%D'", newdecl, newdecl); warned = true; @@ -2960,12 +2963,21 @@ void push_parm_decl (tree parm) { tree decl; + int old_dont_save_pending_sizes_p = 0; /* Don't attempt to expand sizes while parsing this decl. (We can get here with i_s_e 1 somehow from Objective-C.) */ int save_immediate_size_expand = immediate_size_expand; immediate_size_expand = 0; + /* If this is a nested function, we do want to keep SAVE_EXPRs for + the argument sizes, regardless of the parent's setting. */ + if (cfun) + { + old_dont_save_pending_sizes_p = cfun->x_dont_save_pending_sizes_p; + cfun->x_dont_save_pending_sizes_p = 0; + } + decl = grokdeclarator (TREE_VALUE (TREE_PURPOSE (parm)), TREE_PURPOSE (TREE_PURPOSE (parm)), PARM, 0, NULL); @@ -2975,6 +2987,8 @@ push_parm_decl (tree parm) finish_decl (decl, NULL_TREE, NULL_TREE); + if (cfun) + cfun->x_dont_save_pending_sizes_p = old_dont_save_pending_sizes_p; immediate_size_expand = save_immediate_size_expand; } @@ -5990,9 +6004,6 @@ store_parm_decls (void) { tree fndecl = current_function_decl; - /* The function containing FNDECL, if any. */ - tree context = decl_function_context (fndecl); - /* True if this definition is written with a prototype. */ bool prototype = (current_function_parms && TREE_CODE (current_function_parms) != TREE_LIST); @@ -6017,20 +6028,9 @@ store_parm_decls (void) /* Begin the statement tree for this function. */ begin_stmt_tree (&DECL_SAVED_TREE (fndecl)); - /* If this is a nested function, save away the sizes of any - variable-size types so that we can expand them when generating - RTL. */ - if (context) - { - tree t; - - DECL_LANG_SPECIFIC (fndecl)->pending_sizes - = nreverse (get_pending_sizes ()); - for (t = DECL_LANG_SPECIFIC (fndecl)->pending_sizes; - t; - t = TREE_CHAIN (t)) - SAVE_EXPR_CONTEXT (TREE_VALUE (t)) = context; - } + /* Save away the sizes of any variable-size types so that we can + expand them when generating RTL. */ + DECL_LANG_SPECIFIC (fndecl)->pending_sizes = get_pending_sizes (); /* This function is being processed in whole-function mode. */ cfun->x_whole_function_mode_p = 1; @@ -6181,15 +6181,12 @@ static void c_expand_body_1 (tree fndecl, int nested_p) { if (nested_p) - { - /* Make sure that we will evaluate variable-sized types involved - in our function's type. */ - expand_pending_sizes (DECL_LANG_SPECIFIC (fndecl)->pending_sizes); - - /* Squirrel away our current state. */ - push_function_context (); - } + /* Squirrel away our current state. */ + push_function_context (); + /* Make sure that we will evaluate variable-sized types involved + in our function's type. */ + put_pending_sizes (DECL_LANG_SPECIFIC (fndecl)->pending_sizes); tree_rest_of_compilation (fndecl, nested_p); if (nested_p) diff --git a/contrib/gcc-3.4/gcc/c-objc-common.c b/contrib/gcc-3.4/gcc/c-objc-common.c index fe0c0d5b93..0efa2adc37 100644 --- a/contrib/gcc-3.4/gcc/c-objc-common.c +++ b/contrib/gcc-3.4/gcc/c-objc-common.c @@ -118,17 +118,12 @@ c_cannot_inline_tree_fn (tree *fnp) } } - if (! DECL_FILE_SCOPE_P (fn)) + if (DECL_LANG_SPECIFIC (fn)->pending_sizes) { - /* If a nested function has pending sizes, we may have already - saved them. */ - if (DECL_LANG_SPECIFIC (fn)->pending_sizes) - { - if (do_warning) - warning ("%Jnested function '%F' can never be inlined because it " - "has possibly saved pending sizes", fn, fn); - goto cannot_inline; - } + if (do_warning) + warning ("%Jfunction '%F' can never be inlined because it has " + "pending sizes", fn, fn); + goto cannot_inline; } return 0; diff --git a/contrib/gcc-3.4/gcc/c-typeck.c b/contrib/gcc-3.4/gcc/c-typeck.c index 3da121e10f..42c7b77609 100644 --- a/contrib/gcc-3.4/gcc/c-typeck.c +++ b/contrib/gcc-3.4/gcc/c-typeck.c @@ -4098,7 +4098,8 @@ digest_init (tree type, tree init, int require_constant) vector constructor is not constant (e.g. {1,2,3,foo()}) then punt below and handle as a constructor. */ if (code == VECTOR_TYPE - && comptypes (TREE_TYPE (inside_init), type, COMPARE_STRICT) + && TREE_CODE (TREE_TYPE (inside_init)) == VECTOR_TYPE + && vector_types_convertible_p (TREE_TYPE (inside_init), type) && TREE_CONSTANT (inside_init)) { if (TREE_CODE (inside_init) == VECTOR_CST diff --git a/contrib/gcc-3.4/gcc/config/i386/i386.md b/contrib/gcc-3.4/gcc/config/i386/i386.md index 93d9dcdba1..0fbe00b66e 100644 --- a/contrib/gcc-3.4/gcc/config/i386/i386.md +++ b/contrib/gcc-3.4/gcc/config/i386/i386.md @@ -1850,7 +1850,8 @@ (define_split [(set (match_operand:DI 0 "push_operand" "") (match_operand:DI 1 "immediate_operand" ""))] - "TARGET_64BIT && (flow2_completed || (reload_completed && !flag_peephole2)) + "TARGET_64BIT && ((optimize > 0 && flag_peephole2) + ? flow2_completed : reload_completed) && !symbolic_operand (operands[1], DImode) && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 0) (match_dup 1)) @@ -2105,7 +2106,8 @@ (define_split [(set (match_operand:DI 0 "memory_operand" "") (match_operand:DI 1 "immediate_operand" ""))] - "TARGET_64BIT && (flow2_completed || (reload_completed && !flag_peephole2)) + "TARGET_64BIT && ((optimize > 0 && flag_peephole2) + ? flow2_completed : reload_completed) && !symbolic_operand (operands[1], DImode) && !x86_64_immediate_operand (operands[1], DImode)" [(set (match_dup 2) (match_dup 3)) @@ -2172,11 +2174,10 @@ (match_operand:SF 1 "memory_operand" ""))] "reload_completed && GET_CODE (operands[1]) == MEM - && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF - && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))" + && constant_pool_reference_p (operands[1])" [(set (match_dup 0) (match_dup 1))] - "operands[1] = get_pool_constant (XEXP (operands[1], 0));") + "operands[1] = avoid_constant_pool_reference (operands[1]);") ;; %%% Kill this when call knows how to work this out. @@ -2889,11 +2890,10 @@ && GET_CODE (operands[1]) == MEM && (GET_MODE (operands[0]) == XFmode || GET_MODE (operands[0]) == SFmode || GET_MODE (operands[0]) == DFmode) - && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF - && CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))" + && constant_pool_reference_p (operands[1])" [(set (match_dup 0) (match_dup 1))] { - rtx c = get_pool_constant (XEXP (operands[1], 0)); + rtx c = avoid_constant_pool_reference (operands[1]); rtx r = operands[0]; if (GET_CODE (r) == SUBREG) diff --git a/contrib/gcc-3.4/gcc/coverage.c b/contrib/gcc-3.4/gcc/coverage.c index 395c1e4de5..85ba608380 100644 --- a/contrib/gcc-3.4/gcc/coverage.c +++ b/contrib/gcc-3.4/gcc/coverage.c @@ -172,8 +172,8 @@ read_counts_file (void) GCOV_UNSIGNED2STRING (v, tag); GCOV_UNSIGNED2STRING (e, GCOV_VERSION); - warning ("`%s' is version `%.4s', expected version `%.4s'", - da_file_name, v, e); + warning ("`%s' is version `%.*s', expected version `%.*s'", + da_file_name, 4, v, 4, e); gcov_close (); return; } diff --git a/contrib/gcc-3.4/gcc/cp/call.c b/contrib/gcc-3.4/gcc/cp/call.c index 404c2ad123..01c8926b07 100644 --- a/contrib/gcc-3.4/gcc/cp/call.c +++ b/contrib/gcc-3.4/gcc/cp/call.c @@ -1556,7 +1556,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, if (IS_AGGR_TYPE (c1) && DERIVED_FROM_P (c2, c1) && (TYPE_PTRMEMFUNC_P (type2) - || is_complete (TREE_TYPE (TREE_TYPE (type2))))) + || is_complete (TYPE_PTRMEM_POINTED_TO_TYPE (type2)))) break; } return; @@ -2544,7 +2544,7 @@ resolve_args (tree args) { tree arg = TREE_VALUE (t); - if (arg == error_mark_node) + if (error_operand_p (arg)) return error_mark_node; else if (VOID_TYPE_P (TREE_TYPE (arg))) { diff --git a/contrib/gcc-3.4/gcc/cp/class.c b/contrib/gcc-3.4/gcc/cp/class.c index 09daf118a8..c14313c8bf 100644 --- a/contrib/gcc-3.4/gcc/cp/class.c +++ b/contrib/gcc-3.4/gcc/cp/class.c @@ -879,9 +879,10 @@ add_method (tree type, tree method, int error_p) fns = OVL_NEXT (fns)) { tree fn = OVL_CURRENT (fns); + tree fn_type; + tree method_type; tree parms1; tree parms2; - bool same = 1; if (TREE_CODE (fn) != TREE_CODE (method)) continue; @@ -896,8 +897,10 @@ add_method (tree type, tree method, int error_p) functions in the derived class override and/or hide member functions with the same name and parameter types in a base class (rather than conflicting). */ - parms1 = TYPE_ARG_TYPES (TREE_TYPE (fn)); - parms2 = TYPE_ARG_TYPES (TREE_TYPE (method)); + fn_type = TREE_TYPE (fn); + method_type = TREE_TYPE (method); + parms1 = TYPE_ARG_TYPES (fn_type); + parms2 = TYPE_ARG_TYPES (method_type); /* Compare the quals on the 'this' parm. Don't compare the whole types, as used functions are treated as @@ -906,23 +909,25 @@ add_method (tree type, tree method, int error_p) && ! DECL_STATIC_FUNCTION_P (method) && (TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms1))) != TYPE_QUALS (TREE_TYPE (TREE_VALUE (parms2))))) - same = 0; + continue; /* For templates, the template parms must be identical. */ if (TREE_CODE (fn) == TEMPLATE_DECL - && !comp_template_parms (DECL_TEMPLATE_PARMS (fn), - DECL_TEMPLATE_PARMS (method))) - same = 0; + && (!same_type_p (TREE_TYPE (fn_type), + TREE_TYPE (method_type)) + || !comp_template_parms (DECL_TEMPLATE_PARMS (fn), + DECL_TEMPLATE_PARMS (method)))) + continue; if (! DECL_STATIC_FUNCTION_P (fn)) parms1 = TREE_CHAIN (parms1); if (! DECL_STATIC_FUNCTION_P (method)) parms2 = TREE_CHAIN (parms2); - if (same && compparms (parms1, parms2) + if (compparms (parms1, parms2) && (!DECL_CONV_FN_P (fn) - || same_type_p (TREE_TYPE (TREE_TYPE (fn)), - TREE_TYPE (TREE_TYPE (method))))) + || same_type_p (TREE_TYPE (fn_type), + TREE_TYPE (method_type)))) { if (using && DECL_CONTEXT (fn) == type) /* Defer to the local function. */ @@ -2035,11 +2040,7 @@ find_final_overrider (tree derived, tree binfo, tree fn) /* If there was no winner, issue an error message. */ if (!ffod.candidates || TREE_CHAIN (ffod.candidates)) - { - error ("no unique final overrider for `%D' in `%T'", fn, - BINFO_TYPE (derived)); - return error_mark_node; - } + return error_mark_node; return ffod.candidates; } @@ -2099,7 +2100,10 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, /* Find the final overrider. */ overrider = find_final_overrider (TYPE_BINFO (t), b, target_fn); if (overrider == error_mark_node) - return; + { + error ("no unique final overrider for `%D' in `%T'", target_fn, t); + return; + } overrider_target = overrider_fn = TREE_PURPOSE (overrider); /* Check for adjusting covariant return types. */ diff --git a/contrib/gcc-3.4/gcc/cp/cvt.c b/contrib/gcc-3.4/gcc/cp/cvt.c index 8276451cb1..2071c26029 100644 --- a/contrib/gcc-3.4/gcc/cp/cvt.c +++ b/contrib/gcc-3.4/gcc/cp/cvt.c @@ -79,6 +79,8 @@ cp_convert_to_pointer (tree type, tree expr, bool force) tree intype = TREE_TYPE (expr); enum tree_code form; tree rval; + if (intype == error_mark_node) + return error_mark_node; if (IS_AGGR_TYPE (intype)) { diff --git a/contrib/gcc-3.4/gcc/cp/decl.c b/contrib/gcc-3.4/gcc/cp/decl.c index 3f62ad5540..451993eb49 100644 --- a/contrib/gcc-3.4/gcc/cp/decl.c +++ b/contrib/gcc-3.4/gcc/cp/decl.c @@ -1380,10 +1380,7 @@ duplicate_decls (tree newdecl, tree olddecl) else return NULL_TREE; } - - /* Already complained about this, so don't do so again. */ - else if (current_class_type == NULL_TREE - || IDENTIFIER_ERROR_LOCUS (DECL_ASSEMBLER_NAME (newdecl)) != current_class_type) + else { error ("conflicting declaration '%#D'", newdecl); cp_error_at ("'%D' has a previous declaration as `%#D'", @@ -2647,16 +2644,7 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain) return error_mark_node; } my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 20030802); - - if (TREE_CODE (context) == NAMESPACE_DECL) - { - /* We can get here from typename_sub0 in the explicit_template_type - expansion. Just fail. */ - if (complain & tf_error) - error ("no class template named `%#T' in `%#T'", - name, context); - return error_mark_node; - } + my_friendly_assert (TYPE_P (context), 20050905); if (!dependent_type_p (context) || currently_open_class (context)) @@ -5903,6 +5891,7 @@ grokvardecl (tree type, tree scope) { tree decl; + tree explicit_scope; RID_BIT_TYPE specbits; my_friendly_assert (!name || TREE_CODE (name) == IDENTIFIER_NODE, @@ -5910,7 +5899,9 @@ grokvardecl (tree type, specbits = *specbits_in; - /* Compute the scope in which to place the variable. */ + /* Compute the scope in which to place the variable, but remember + whether or not that scope was explicitly specified by the user. */ + explicit_scope = scope; if (!scope) { /* An explicit "extern" specifier indicates a namespace-scope @@ -5939,8 +5930,8 @@ grokvardecl (tree type, else decl = build_decl (VAR_DECL, name, type); - if (scope && TREE_CODE (scope) == NAMESPACE_DECL) - set_decl_namespace (decl, scope, 0); + if (explicit_scope && TREE_CODE (explicit_scope) == NAMESPACE_DECL) + set_decl_namespace (decl, explicit_scope, 0); else DECL_CONTEXT (decl) = scope; @@ -7197,8 +7188,8 @@ grokdeclarator (tree declarator, if (virtualp && staticp == 2) { - error ("member `%D' cannot be declared both virtual and static", - dname); + error ("member `%D' cannot be declared both virtual and static", dname); + RIDBIT_RESET (RID_STATIC, specbits); staticp = 0; } friendp = RIDBIT_SETP (RID_FRIEND, specbits); @@ -9022,17 +9013,19 @@ grok_op_properties (tree decl, bool complain) tree name = DECL_NAME (decl); enum tree_code operator_code; int arity; + bool ellipsis_p; bool ok; tree class_type; /* Assume that the declaration is valid. */ ok = true; - /* Count the number of arguments. */ + /* Count the number of arguments. and check for ellipsis */ for (argtype = argtypes, arity = 0; argtype && argtype != void_list_node; argtype = TREE_CHAIN (argtype)) ++arity; + ellipsis_p = !argtype; class_type = DECL_CONTEXT (decl); if (class_type && !CLASS_TYPE_P (class_type)) @@ -9172,11 +9165,14 @@ grok_op_properties (tree decl, bool complain) warning ("conversion to %s%s will never use a type conversion operator", ref ? "a reference to " : "", what); } + if (operator_code == COND_EXPR) { /* 13.4.0.3 */ error ("ISO C++ prohibits overloading operator ?:"); } + else if (ellipsis_p) + error ("`%D' must not have variable number of arguments", decl); else if (ambi_op_p (operator_code)) { if (arity == 1) @@ -9341,9 +9337,11 @@ tag_name (enum tag_types code) case class_type: return "class"; case union_type: - return "union "; + return "union"; case enum_type: return "enum"; + case typename_type: + return "typename"; default: abort (); } @@ -9381,7 +9379,8 @@ check_elaborated_type_specifier (enum tag_types tag_code, In other words, the only legitimate declaration to use in the elaborated type specifier is the implicit typedef created when the type is declared. */ - if (!DECL_IMPLICIT_TYPEDEF_P (decl)) + if (!DECL_IMPLICIT_TYPEDEF_P (decl) + && tag_code != typename_type) { error ("using typedef-name `%D' after `%s'", decl, tag_name (tag_code)); return IS_AGGR_TYPE (type) ? type : error_mark_node; @@ -9395,7 +9394,8 @@ check_elaborated_type_specifier (enum tag_types tag_code, } else if (TREE_CODE (type) != RECORD_TYPE && TREE_CODE (type) != UNION_TYPE - && tag_code != enum_type) + && tag_code != enum_type + && tag_code != typename_type) { error ("`%T' referred to as `%s'", type, tag_name (tag_code)); return error_mark_node; @@ -10317,7 +10317,11 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) class scope, current_class_type will be NULL_TREE until set above by push_nested_class.) */ if (processing_template_decl) - decl1 = push_template_decl (decl1); + { + tree newdecl1 = push_template_decl (decl1); + if (newdecl1 != error_mark_node) + decl1 = newdecl1; + } /* We are now in the scope of the function being defined. */ current_function_decl = decl1; @@ -10331,6 +10335,8 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) must be complete when you define the function. */ if (! processing_template_decl) check_function_type (decl1, current_function_parms); + /* Make sure no default arg is missing. */ + check_default_args (decl1); /* Build the return declaration for the function. */ restype = TREE_TYPE (fntype); @@ -10394,8 +10400,6 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) /* We need to set the DECL_CONTEXT. */ if (!DECL_CONTEXT (decl1) && DECL_TEMPLATE_INFO (decl1)) DECL_CONTEXT (decl1) = DECL_CONTEXT (DECL_TI_TEMPLATE (decl1)); - /* And make sure we have enough default args. */ - check_default_args (decl1); } fntype = TREE_TYPE (decl1); } diff --git a/contrib/gcc-3.4/gcc/cp/decl2.c b/contrib/gcc-3.4/gcc/cp/decl2.c index 09fe5ddea0..abd86f7abe 100644 --- a/contrib/gcc-3.4/gcc/cp/decl2.c +++ b/contrib/gcc-3.4/gcc/cp/decl2.c @@ -64,7 +64,6 @@ typedef struct priority_info_s { static void mark_vtable_entries (tree); static void grok_function_init (tree, tree); static bool maybe_emit_vtables (tree); -static tree build_anon_union_vars (tree); static bool acceptable_java_type (tree); static tree start_objects (int, int); static void finish_objects (int, int, tree); @@ -1131,14 +1130,13 @@ defer_fn (tree fn) VARRAY_PUSH_TREE (deferred_fns, fn); } -/* Walks through the namespace- or function-scope anonymous union OBJECT, - building appropriate ALIAS_DECLs. Returns one of the fields for use in - the mangled name. */ +/* Walks through the namespace- or function-scope anonymous union + OBJECT, with the indicated TYPE, building appropriate ALIAS_DECLs. + Returns one of the fields for use in the mangled name. */ static tree -build_anon_union_vars (tree object) +build_anon_union_vars (tree type, tree object) { - tree type = TREE_TYPE (object); tree main_decl = NULL_TREE; tree field; @@ -1185,7 +1183,7 @@ build_anon_union_vars (tree object) decl = pushdecl (decl); } else if (ANON_AGGR_TYPE_P (TREE_TYPE (field))) - decl = build_anon_union_vars (ref); + decl = build_anon_union_vars (TREE_TYPE (field), ref); else decl = 0; @@ -1225,7 +1223,7 @@ finish_anon_union (tree anon_union_decl) return; } - main_decl = build_anon_union_vars (anon_union_decl); + main_decl = build_anon_union_vars (type, anon_union_decl); if (main_decl == NULL_TREE) { warning ("anonymous union with no members"); @@ -2961,7 +2959,7 @@ check_default_args (tree x) { cp_error_at ("default argument missing for parameter %P of `%+#D'", i, x); - break; + TREE_PURPOSE (arg) = error_mark_node; } } } @@ -2969,6 +2967,18 @@ check_default_args (tree x) void mark_used (tree decl) { + /* If DECL is a BASELINK for a single function, then treat it just + like the DECL for the function. Otherwise, if the BASELINK is + for an overloaded function, we don't know which function was + actually used until after overload resolution. */ + if (TREE_CODE (decl) == BASELINK) + { + decl = BASELINK_FUNCTIONS (decl); + if (really_overloaded_fn (decl)) + return; + decl = OVL_CURRENT (decl); + } + TREE_USED (decl) = 1; if (processing_template_decl || skip_evaluation) return; diff --git a/contrib/gcc-3.4/gcc/cp/error.c b/contrib/gcc-3.4/gcc/cp/error.c index 5b83c60746..381b5bec66 100644 --- a/contrib/gcc-3.4/gcc/cp/error.c +++ b/contrib/gcc-3.4/gcc/cp/error.c @@ -1307,6 +1307,7 @@ dump_expr (tree t, int flags) case FUNCTION_DECL: case TEMPLATE_DECL: case NAMESPACE_DECL: + case LABEL_DECL: case OVERLOAD: case IDENTIFIER_NODE: dump_decl (t, (flags & ~TFF_DECL_SPECIFIERS) | TFF_NO_FUNCTION_ARGUMENTS); @@ -1547,6 +1548,8 @@ dump_expr (tree t, int flags) || (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE)) dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS); + else if (TREE_CODE (TREE_OPERAND (t, 0)) == LABEL_DECL) + dump_unary_op ("&&", t, flags); else dump_unary_op ("&", t, flags); break; diff --git a/contrib/gcc-3.4/gcc/cp/init.c b/contrib/gcc-3.4/gcc/cp/init.c index 732d4a0c84..4e3cd4bef4 100644 --- a/contrib/gcc-3.4/gcc/cp/init.c +++ b/contrib/gcc-3.4/gcc/cp/init.c @@ -1015,11 +1015,11 @@ expand_member_init (tree name) if (!direct_binfo && !virtual_binfo) { if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type)) - error ("type `%D' is not a direct or virtual base of `%T'", - name, current_class_type); + error ("type `%T' is not a direct or virtual base of `%T'", + basetype, current_class_type); else - error ("type `%D' is not a direct base of `%T'", - name, current_class_type); + error ("type `%T' is not a direct base of `%T'", + basetype, current_class_type); return NULL_TREE; } @@ -2075,9 +2075,6 @@ build_new_1 (tree exp) fns = lookup_fnfields (true_type, fnname, /*protect=*/2); if (!fns) { - /* See PR 15967. This should never happen (and it is - fixed correctly in mainline), but on the release branch - we prefer this less-intrusive approacch. */ error ("no suitable or ambiguous `%D' found in class `%T'", fnname, true_type); return error_mark_node; diff --git a/contrib/gcc-3.4/gcc/cp/lex.c b/contrib/gcc-3.4/gcc/cp/lex.c index 2239c76ca8..66e45ed905 100644 --- a/contrib/gcc-3.4/gcc/cp/lex.c +++ b/contrib/gcc-3.4/gcc/cp/lex.c @@ -627,26 +627,18 @@ unqualified_name_lookup_error (tree name) if (name != ansi_opname (ERROR_MARK)) error ("`%D' not defined", name); } - else if (current_function_decl == 0) - error ("`%D' was not declared in this scope", name); else { - if (IDENTIFIER_NAMESPACE_VALUE (name) != error_mark_node - || IDENTIFIER_ERROR_LOCUS (name) != current_function_decl) + error ("`%D' was not declared in this scope", name); + /* Prevent repeated error messages by creating a VAR_DECL with + this NAME in the innermost block scope. */ + if (current_function_decl) { - static int undeclared_variable_notice; - - error ("`%D' undeclared (first use this function)", name); - - if (! undeclared_variable_notice) - { - error ("(Each undeclared identifier is reported only once for each function it appears in.)"); - undeclared_variable_notice = 1; - } + tree decl; + decl = build_decl (VAR_DECL, name, error_mark_node); + DECL_CONTEXT (decl) = current_function_decl; + push_local_binding (name, decl, 0); } - /* Prevent repeated error messages. */ - SET_IDENTIFIER_NAMESPACE_VALUE (name, error_mark_node); - SET_IDENTIFIER_ERROR_LOCUS (name, current_function_decl); } return error_mark_node; diff --git a/contrib/gcc-3.4/gcc/cp/method.c b/contrib/gcc-3.4/gcc/cp/method.c index ef69c37fe4..9f3e72e9cf 100644 --- a/contrib/gcc-3.4/gcc/cp/method.c +++ b/contrib/gcc-3.4/gcc/cp/method.c @@ -851,7 +851,7 @@ synthesize_exception_spec (tree type, tree (*extractor) (tree, void*), continue; while (TREE_CODE (type) == ARRAY_TYPE) type = TREE_TYPE (type); - if (TREE_CODE (type) != RECORD_TYPE) + if (!CLASS_TYPE_P (type)) continue; fn = (*extractor) (type, client); @@ -896,7 +896,9 @@ locate_ctor (tree type, void *client ATTRIBUTE_UNUSED) tree fn = OVL_CURRENT (fns); tree parms = TYPE_ARG_TYPES (TREE_TYPE (fn)); - if (sufficient_parms_p (TREE_CHAIN (parms))) + parms = skip_artificial_parms_for (fn, parms); + + if (sufficient_parms_p (parms)) return fn; } return NULL_TREE; @@ -940,7 +942,7 @@ locate_copy (tree type, void *client_) int excess; int quals; - parms = TREE_CHAIN (parms); + parms = skip_artificial_parms_for (fn, parms); if (!parms) continue; src_type = non_reference (TREE_VALUE (parms)); diff --git a/contrib/gcc-3.4/gcc/cp/name-lookup.c b/contrib/gcc-3.4/gcc/cp/name-lookup.c index 3e79d3e568..870eaabe12 100644 --- a/contrib/gcc-3.4/gcc/cp/name-lookup.c +++ b/contrib/gcc-3.4/gcc/cp/name-lookup.c @@ -35,7 +35,6 @@ static cxx_scope *innermost_nonclass_level (void); static tree select_decl (cxx_binding *, int); static cxx_binding *binding_for_name (cxx_scope *, tree); static tree lookup_name_current_level (tree); -static void push_local_binding (tree, tree, int); static tree push_overloaded_decl (tree, int); static bool lookup_using_namespace (tree, cxx_binding *, tree, tree, int); @@ -607,6 +606,9 @@ pushdecl (tree x) { int different_binding_level = 0; + if (TREE_CODE (x) == FUNCTION_DECL || DECL_FUNCTION_TEMPLATE_P (x)) + check_default_args (x); + if (TREE_CODE (name) == TEMPLATE_ID_EXPR) name = TREE_OPERAND (name, 0); @@ -718,8 +720,6 @@ pushdecl (tree x) { if (TREE_CODE (t) == TYPE_DECL) SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (t)); - else if (TREE_CODE (t) == FUNCTION_DECL) - check_default_args (t); POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); } @@ -1002,9 +1002,6 @@ pushdecl (tree x) } } - if (TREE_CODE (x) == FUNCTION_DECL) - check_default_args (x); - if (TREE_CODE (x) == VAR_DECL) maybe_register_incomplete_var (x); } @@ -1052,7 +1049,7 @@ maybe_push_decl (tree decl) doesn't really belong to this binding level, that it got here through a using-declaration. */ -static void +void push_local_binding (tree id, tree decl, int flags) { struct cp_binding_level *b; @@ -1180,6 +1177,10 @@ check_for_out_of_scope_variable (tree decl) return decl; DECL_ERROR_REPORTED (decl) = 1; + + if (TREE_TYPE (decl) == error_mark_node) + return decl; + if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (decl))) { error ("name lookup of `%D' changed for new ISO `for' scoping", @@ -3021,7 +3022,13 @@ set_decl_namespace (tree decl, tree scope, bool friendp) return; } else - return; + { + /* Writing "int N::i" to declare a variable within "N" is invalid. */ + if (at_namespace_scope_p ()) + error ("explicit qualification in declaration of `%D'", decl); + return; + } + complain: error ("`%D' should have been declared inside `%D'", decl, scope); @@ -3199,12 +3206,10 @@ namespace_ancestor (tree ns1, tree ns2) void do_namespace_alias (tree alias, tree namespace) { - if (TREE_CODE (namespace) != NAMESPACE_DECL) - { - /* The parser did not find it, so it's not there. */ - error ("unknown namespace `%D'", namespace); - return; - } + if (namespace == error_mark_node) + return; + + my_friendly_assert (TREE_CODE (namespace) == NAMESPACE_DECL, 20050830); namespace = ORIGINAL_NAMESPACE (namespace); @@ -3345,26 +3350,15 @@ do_toplevel_using_decl (tree decl, tree scope, tree name) void do_using_directive (tree namespace) { + if (namespace == error_mark_node) + return; + + my_friendly_assert (TREE_CODE (namespace) == NAMESPACE_DECL, 20050830); + if (building_stmt_tree ()) add_stmt (build_stmt (USING_STMT, namespace)); - - /* using namespace A::B::C; */ - if (TREE_CODE (namespace) == SCOPE_REF) - namespace = TREE_OPERAND (namespace, 1); - if (TREE_CODE (namespace) == IDENTIFIER_NODE) - { - /* Lookup in lexer did not find a namespace. */ - if (!processing_template_decl) - error ("namespace `%T' undeclared", namespace); - return; - } - if (TREE_CODE (namespace) != NAMESPACE_DECL) - { - if (!processing_template_decl) - error ("`%T' is not a namespace", namespace); - return; - } namespace = ORIGINAL_NAMESPACE (namespace); + if (!toplevel_bindings_p ()) push_using_directive (namespace); else @@ -4437,9 +4431,10 @@ arg_assoc (struct arg_lookup *k, tree n) return true; /* Now the arguments. */ - for (ix = TREE_VEC_LENGTH (args); ix--;) - if (arg_assoc_template_arg (k, TREE_VEC_ELT (args, ix)) == 1) - return true; + if (args) + for (ix = TREE_VEC_LENGTH (args); ix--;) + if (arg_assoc_template_arg (k, TREE_VEC_ELT (args, ix)) == 1) + return true; } else if (TREE_CODE (n) == OVERLOAD) { diff --git a/contrib/gcc-3.4/gcc/cp/name-lookup.h b/contrib/gcc-3.4/gcc/cp/name-lookup.h index 8377575205..1ade1a91f3 100644 --- a/contrib/gcc-3.4/gcc/cp/name-lookup.h +++ b/contrib/gcc-3.4/gcc/cp/name-lookup.h @@ -287,6 +287,7 @@ extern tree lookup_namespace_name (tree, tree); extern tree lookup_qualified_name (tree, tree, bool, bool); extern tree lookup_name_nonclass (tree); extern tree lookup_function_nonclass (tree, tree); +extern void push_local_binding (tree, tree, int); extern int push_class_binding (tree, tree); extern bool pushdecl_class_level (tree); extern tree pushdecl_namespace_level (tree); diff --git a/contrib/gcc-3.4/gcc/cp/parser.c b/contrib/gcc-3.4/gcc/cp/parser.c index c59d40992b..032cbd7e9b 100644 --- a/contrib/gcc-3.4/gcc/cp/parser.c +++ b/contrib/gcc-3.4/gcc/cp/parser.c @@ -1719,7 +1719,7 @@ static bool cp_parser_simulate_error static void cp_parser_check_type_definition (cp_parser *); static void cp_parser_check_for_definition_in_return_type - (tree, int); + (tree, tree); static void cp_parser_check_for_invalid_template_id (cp_parser *, tree); static bool cp_parser_non_integral_constant_expression @@ -1851,14 +1851,13 @@ cp_parser_check_type_definition (cp_parser* parser) error ("%s", parser->type_definition_forbidden_message); } -/* This function is called when a declaration is parsed. If - DECLARATOR is a function declarator and DECLARES_CLASS_OR_ENUM - indicates that a type was defined in the decl-specifiers for DECL, - then an error is issued. */ +/* This function is called when the DECLARATOR is processed. The TYPE + was a type defined in the decl-specifiers. If it is invalid to + define a type in the decl-specifiers for DECLARATOR, an error is + issued. */ static void -cp_parser_check_for_definition_in_return_type (tree declarator, - int declares_class_or_enum) +cp_parser_check_for_definition_in_return_type (tree declarator, tree type) { /* [dcl.fct] forbids type definitions in return types. Unfortunately, it's not easy to know whether or not we are @@ -1868,9 +1867,12 @@ cp_parser_check_for_definition_in_return_type (tree declarator, || TREE_CODE (declarator) == ADDR_EXPR)) declarator = TREE_OPERAND (declarator, 0); if (declarator - && TREE_CODE (declarator) == CALL_EXPR - && declares_class_or_enum & 2) - error ("new types may not be defined in a return type"); + && TREE_CODE (declarator) == CALL_EXPR) + { + error ("new types may not be defined in a return type"); + inform ("(perhaps a semicolon is missing after the definition of `%T')", + type); + } } /* A type-specifier (TYPE) has been parsed which cannot be followed by @@ -3550,52 +3552,13 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) case RID_TYPENAME: { - bool template_p = false; - tree id; tree type; - tree scope; - - /* Consume the `typename' token. */ - cp_lexer_consume_token (parser->lexer); - /* Look for the optional `::' operator. */ - cp_parser_global_scope_opt (parser, - /*current_scope_valid_p=*/false); - /* Look for the nested-name-specifier. In case of error here, - consume the trailing id to avoid subsequent error messages - for usual cases. */ - scope = cp_parser_nested_name_specifier (parser, - /*typename_keyword_p=*/true, - /*check_dependency_p=*/true, - /*type_p=*/true, - /*is_declaration=*/true); - - /* Look for the optional `template' keyword. */ - template_p = cp_parser_optional_template_keyword (parser); - /* We don't know whether we're looking at a template-id or an - identifier. */ - cp_parser_parse_tentatively (parser); - /* Try a template-id. */ - id = cp_parser_template_id (parser, template_p, - /*check_dependency_p=*/true, - /*is_declaration=*/true); - /* If that didn't work, try an identifier. */ - if (!cp_parser_parse_definitely (parser)) - id = cp_parser_identifier (parser); - - /* Don't process id if nested name specifier is invalid. */ - if (scope == error_mark_node) - return error_mark_node; - /* If we look up a template-id in a non-dependent qualifying - scope, there's no need to create a dependent type. */ - else if (TREE_CODE (id) == TYPE_DECL - && !dependent_type_p (parser->scope)) - type = TREE_TYPE (id); - /* Create a TYPENAME_TYPE to represent the type to which the - functional cast is being performed. */ - else - type = make_typename_type (parser->scope, id, - /*complain=*/1); + /* The syntax permitted here is the same permitted for an + elaborated-type-specifier. */ + type = cp_parser_elaborated_type_specifier (parser, + /*is_friend=*/false, + /*is_declaration=*/false); postfix_expression = cp_parser_functional_cast (parser, type); } break; @@ -3966,20 +3929,29 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) if (parser->scope) idk = CP_ID_KIND_QUALIFIED; - if (name != error_mark_node - && !BASELINK_P (name) - && parser->scope) + /* If the name is a template-id that names a type, we will + get a TYPE_DECL here. That is invalid code. */ + if (TREE_CODE (name) == TYPE_DECL) { - name = build_nt (SCOPE_REF, parser->scope, name); - parser->scope = NULL_TREE; - parser->qualifying_scope = NULL_TREE; - parser->object_scope = NULL_TREE; + error ("invalid use of `%D'", name); + postfix_expression = error_mark_node; + } + else + { + if (name != error_mark_node && !BASELINK_P (name) + && parser->scope) + { + name = build_nt (SCOPE_REF, parser->scope, name); + parser->scope = NULL_TREE; + parser->qualifying_scope = NULL_TREE; + parser->object_scope = NULL_TREE; + } + if (scope && name && BASELINK_P (name)) + adjust_result_of_qualified_name_lookup + (name, BINFO_TYPE (BASELINK_BINFO (name)), scope); + postfix_expression = finish_class_member_access_expr + (postfix_expression, name); } - if (scope && name && BASELINK_P (name)) - adjust_result_of_qualified_name_lookup - (name, BINFO_TYPE (BASELINK_BINFO (name)), scope); - postfix_expression - = finish_class_member_access_expr (postfix_expression, name); } /* We no longer need to look up names in the scope of the @@ -8628,8 +8600,9 @@ cp_parser_explicit_instantiation (cp_parser* parser) /*ctor_dtor_or_conv_p=*/NULL, /*parenthesized_p=*/NULL, /*member_p=*/false); - cp_parser_check_for_definition_in_return_type (declarator, - declares_class_or_enum); + if (declares_class_or_enum & 2) + cp_parser_check_for_definition_in_return_type + (declarator, TREE_VALUE (decl_specifiers)); if (declarator != error_mark_node) { decl = grokdeclarator (declarator, decl_specifiers, @@ -9236,7 +9209,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, } /* For a `typename', we needn't call xref_tag. */ - if (tag_type == typename_type) + if (tag_type == typename_type + && TREE_CODE (parser->scope) != NAMESPACE_DECL) return make_typename_type (parser->scope, identifier, /*complain=*/1); /* Look up a qualified name in the usual way. */ @@ -9280,7 +9254,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, if (TREE_CODE (decl) != TYPE_DECL) { - error ("expected type-name"); + cp_parser_diagnose_invalid_type_name (parser); return error_mark_node; } @@ -9532,6 +9506,9 @@ cp_parser_namespace_name (cp_parser* parser) if (namespace_decl == error_mark_node || TREE_CODE (namespace_decl) != NAMESPACE_DECL) { + if (!cp_parser_parsing_tentatively (parser) + || cp_parser_committed_to_tentative_parse (parser)) + error ("`%D' is not a namespace-name", identifier); cp_parser_error (parser, "expected namespace-name"); namespace_decl = error_mark_node; } @@ -10000,8 +9977,9 @@ cp_parser_init_declarator (cp_parser* parser, if (declarator == error_mark_node) return error_mark_node; - cp_parser_check_for_definition_in_return_type (declarator, - declares_class_or_enum); + if (declares_class_or_enum & 2) + cp_parser_check_for_definition_in_return_type + (declarator, TREE_VALUE (decl_specifiers)); /* Figure out what scope the entity declared by the DECLARATOR is located in. `grokdeclarator' sometimes changes the scope, so @@ -10927,7 +10905,7 @@ cp_parser_declarator_id (cp_parser* parser) /*declarator_p=*/true); /* If the name was qualified, create a SCOPE_REF to represent that. */ - if (parser->scope) + if (parser->scope && id_expression != error_mark_node) { id_expression = build_nt (SCOPE_REF, parser->scope, id_expression); parser->scope = NULL_TREE; @@ -12501,8 +12479,13 @@ cp_parser_member_declaration (cp_parser* parser) /* Check for a template-declaration. */ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_TEMPLATE)) { - /* Parse the template-declaration. */ - cp_parser_template_declaration (parser, /*member_p=*/true); + /* An explicit specialization here is an error condition, and we + expect the specialization handler to detect and report this. */ + if (cp_lexer_peek_nth_token (parser->lexer, 2)->type == CPP_LESS + && cp_lexer_peek_nth_token (parser->lexer, 3)->type == CPP_GREATER) + cp_parser_explicit_specialization (parser); + else + cp_parser_template_declaration (parser, /*member_p=*/true); return; } @@ -12703,8 +12686,9 @@ cp_parser_member_declaration (cp_parser* parser) return; } - cp_parser_check_for_definition_in_return_type - (declarator, declares_class_or_enum); + if (declares_class_or_enum & 2) + cp_parser_check_for_definition_in_return_type + (declarator, TREE_VALUE (decl_specifiers)); /* Look for an asm-specification. */ asm_specification = cp_parser_asm_specification_opt (parser); @@ -13710,6 +13694,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name, bool is_type, bool is_template, bool is_namespace, bool check_dependency) { + int flags = 0; tree decl; tree object_type = parser->context->object_type; @@ -13721,6 +13706,10 @@ cp_parser_lookup_name (cp_parser *parser, tree name, if (name == error_mark_node) return error_mark_node; + if (!cp_parser_parsing_tentatively (parser) + || cp_parser_committed_to_tentative_parse (parser)) + flags |= LOOKUP_COMPLAIN; + /* A template-id has already been resolved; there is no lookup to do. */ if (TREE_CODE (name) == TEMPLATE_ID_EXPR) @@ -13834,8 +13823,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name, /*protect=*/0, is_type); /* Look it up in the enclosing context, too. */ decl = lookup_name_real (name, is_type, /*nonclass=*/0, - is_namespace, - /*flags=*/0); + is_namespace, flags); parser->object_scope = object_type; parser->qualifying_scope = NULL_TREE; if (object_decl) @@ -13844,8 +13832,7 @@ cp_parser_lookup_name (cp_parser *parser, tree name, else { decl = lookup_name_real (name, is_type, /*nonclass=*/0, - is_namespace, - /*flags=*/0); + is_namespace, flags); parser->qualifying_scope = NULL_TREE; parser->object_scope = NULL_TREE; } @@ -14627,8 +14614,10 @@ cp_parser_functional_cast (cp_parser* parser, tree type) cast = build_functional_cast (type, expression_list); /* [expr.const]/1: In an integral constant expression "only type conversions to integral or enumeration type can be used". */ - if (cast != error_mark_node && !type_dependent_expression_p (type) - && !INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (type))) + if (TREE_CODE (type) == TYPE_DECL) + type = TREE_TYPE (type); + if (cast != error_mark_node && !dependent_type_p (type) + && !INTEGRAL_OR_ENUMERATION_TYPE_P (type)) { if (cp_parser_non_integral_constant_expression (parser, "a call to a constructor")) @@ -14750,8 +14739,8 @@ cp_parser_enclosed_template_argument_list (cp_parser* parser) cp_lexer_consume_token (parser->lexer); } } - else if (!cp_parser_require (parser, CPP_GREATER, "`>'")) - error ("missing `>' to terminate the template argument list"); + else + cp_parser_skip_until_found (parser, CPP_GREATER, "`>'"); /* The `>' token might be a greater-than operator again now. */ parser->greater_than_is_operator_p = saved_greater_than_is_operator_p; @@ -14940,6 +14929,9 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn) parser->local_variables_forbidden_p = saved_local_variables_forbidden_p; } + /* Make sure no default arg is missing. */ + check_default_args (fn); + /* Restore the queue. */ parser->unparsed_functions_queues = TREE_CHAIN (parser->unparsed_functions_queues); diff --git a/contrib/gcc-3.4/gcc/cp/pt.c b/contrib/gcc-3.4/gcc/cp/pt.c index 25e512e060..0ae2d23e70 100644 --- a/contrib/gcc-3.4/gcc/cp/pt.c +++ b/contrib/gcc-3.4/gcc/cp/pt.c @@ -744,8 +744,12 @@ check_specialization_namespace (tree tmpl) void maybe_process_partial_specialization (tree type) { - /* TYPE maybe an ERROR_MARK_NODE. */ - tree context = TYPE_P (type) ? TYPE_CONTEXT (type) : NULL_TREE; + tree context; + + if (type == error_mark_node) + return; + + context = TYPE_CONTEXT (type); if (CLASS_TYPE_P (type) && CLASSTYPE_USE_TEMPLATE (type)) { @@ -2837,9 +2841,8 @@ push_template_decl_real (tree decl, int is_friend) return decl; } } - else if ((DECL_IMPLICIT_TYPEDEF_P (decl) - && CLASS_TYPE_P (TREE_TYPE (decl))) - || (TREE_CODE (decl) == VAR_DECL && ctx && CLASS_TYPE_P (ctx))) + else if (DECL_IMPLICIT_TYPEDEF_P (decl) + && CLASS_TYPE_P (TREE_TYPE (decl))) /* OK */; else { @@ -2978,6 +2981,7 @@ push_template_decl_real (tree decl, int is_friend) error ("got %d template parameters for `%#T'", TREE_VEC_LENGTH (a), current); error (" but %d required", TREE_VEC_LENGTH (t)); + return error_mark_node; } /* Perhaps we should also check that the parms are used in the @@ -4804,11 +4808,14 @@ uses_template_parms (tree t) else if (TREE_CODE (t) == TREE_LIST) dependent_p = (uses_template_parms (TREE_VALUE (t)) || uses_template_parms (TREE_CHAIN (t))); + else if (TREE_CODE (t) == TYPE_DECL) + dependent_p = dependent_type_p (TREE_TYPE (t)); else if (DECL_P (t) || EXPR_P (t) || TREE_CODE (t) == TEMPLATE_PARM_INDEX || TREE_CODE (t) == OVERLOAD || TREE_CODE (t) == BASELINK + || TREE_CODE (t) == IDENTIFIER_NODE || TREE_CODE_CLASS (TREE_CODE (t)) == 'c') dependent_p = (type_dependent_expression_p (t) || value_dependent_expression_p (t)); @@ -5782,6 +5789,12 @@ tsubst_template_parms (tree parms, tree args, tsubst_flags_t complain) tree r = NULL_TREE; tree* new_parms; + /* When substituting into a template, we must set + PROCESSING_TEMPLATE_DECL as the template parameters may be + dependent if they are based on one-another, and the dependency + predicates are short-circuit outside of templates. */ + ++processing_template_decl; + for (new_parms = &r; TMPL_PARMS_DEPTH (parms) > TMPL_ARGS_DEPTH (args); new_parms = &(TREE_CHAIN (*new_parms)), @@ -5811,6 +5824,8 @@ tsubst_template_parms (tree parms, tree args, tsubst_flags_t complain) new_vec, NULL_TREE); } + --processing_template_decl; + return r; } @@ -5996,8 +6011,14 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain) : DECL_TI_ARGS (DECL_TEMPLATE_RESULT (t)); tree full_args; + /* Because this is a template, the arguments will still be + dependent, even after substitution. If + PROCESSING_TEMPLATE_DECL is not set, the dependency + predicates will short-circuit. */ + ++processing_template_decl; full_args = tsubst_template_args (tmpl_args, args, complain, in_decl); + --processing_template_decl; /* tsubst_template_args doesn't copy the vector if nothing changed. But, *something* should have @@ -6029,15 +6050,14 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain) break; } - DECL_CONTEXT (r) - = tsubst_aggr_type (DECL_CONTEXT (t), args, - complain, in_decl, - /*entering_scope=*/1); DECL_TEMPLATE_INFO (r) = build_tree_list (t, args); if (TREE_CODE (decl) == TYPE_DECL) { - tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl); + tree new_type; + ++processing_template_decl; + new_type = tsubst (TREE_TYPE (t), args, complain, in_decl); + --processing_template_decl; if (new_type == error_mark_node) return error_mark_node; @@ -6045,10 +6065,14 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain) CLASSTYPE_TI_TEMPLATE (new_type) = r; DECL_TEMPLATE_RESULT (r) = TYPE_MAIN_DECL (new_type); DECL_TI_ARGS (r) = CLASSTYPE_TI_ARGS (new_type); + DECL_CONTEXT (r) = TYPE_CONTEXT (new_type); } else { - tree new_decl = tsubst (decl, args, complain, in_decl); + tree new_decl; + ++processing_template_decl; + new_decl = tsubst (decl, args, complain, in_decl); + --processing_template_decl; if (new_decl == error_mark_node) return error_mark_node; @@ -6056,6 +6080,7 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain) DECL_TI_TEMPLATE (new_decl) = r; TREE_TYPE (r) = TREE_TYPE (new_decl); DECL_TI_ARGS (r) = DECL_TI_ARGS (new_decl); + DECL_CONTEXT (r) = DECL_CONTEXT (new_decl); } SET_DECL_IMPLICIT_INSTANTIATION (r); @@ -7782,6 +7807,10 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) in_decl), tsubst (TREE_TYPE (t), args, complain, in_decl)); + case OFFSET_REF: + mark_used (TREE_OPERAND (t, 1)); + return t; + default: return t; } @@ -12027,7 +12056,8 @@ type_dependent_expression_p (tree expression) return true; expression = TREE_OPERAND (expression, 0); } - if (TREE_CODE (expression) == OVERLOAD) + if (TREE_CODE (expression) == OVERLOAD + || TREE_CODE (expression) == FUNCTION_DECL) { while (expression) { @@ -12040,6 +12070,8 @@ type_dependent_expression_p (tree expression) abort (); } + my_friendly_assert (TREE_CODE (expression) != TYPE_DECL, 20051116); + return (dependent_type_p (TREE_TYPE (expression))); } diff --git a/contrib/gcc-3.4/gcc/cp/search.c b/contrib/gcc-3.4/gcc/cp/search.c index 0dfdb92297..c227175b0c 100644 --- a/contrib/gcc-3.4/gcc/cp/search.c +++ b/contrib/gcc-3.4/gcc/cp/search.c @@ -946,8 +946,12 @@ accessible_p (tree type, tree decl) /* In a template declaration, we cannot be sure whether the particular specialization that is instantiated will be a friend or not. Therefore, all access checks are deferred until - instantiation. */ - if (processing_template_decl) + instantiation. However, PROCESSING_TEMPLATE_DECL is set in the + parameter list for a template (because we may see dependent types + in default arguments for template parameters), and access + checking should be performed in the outermost parameter list. */ + if (processing_template_decl + && (!processing_template_parmlist || processing_template_decl > 1)) return 1; if (!TYPE_P (type)) diff --git a/contrib/gcc-3.4/gcc/cp/semantics.c b/contrib/gcc-3.4/gcc/cp/semantics.c index bb2f3c925a..943e7a1a92 100644 --- a/contrib/gcc-3.4/gcc/cp/semantics.c +++ b/contrib/gcc-3.4/gcc/cp/semantics.c @@ -2295,7 +2295,9 @@ check_multiple_declarators (void) void qualified_name_lookup_error (tree scope, tree name) { - if (TYPE_P (scope)) + if (scope == error_mark_node) + ; /* We already complained. */ + else if (TYPE_P (scope)) { if (!COMPLETE_TYPE_P (scope)) error ("incomplete type `%T' used in nested name specifier", scope); @@ -2398,6 +2400,21 @@ finish_id_expression (tree id_expression, was entirely defined. */ if (!scope && decl != error_mark_node) maybe_note_name_used_in_class (id_expression, decl); + + /* Disallow uses of local variables from containing functions. */ + if (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL) + { + tree context = decl_function_context (decl); + if (context != NULL_TREE && context != current_function_decl + && ! TREE_STATIC (decl)) + { + error (TREE_CODE (decl) == VAR_DECL + ? "use of `auto' variable from containing function" + : "use of parameter from containing function"); + cp_error_at (" `%#D' declared here", decl); + return error_mark_node; + } + } } /* If we didn't find anything, or what we found was a type, @@ -2664,23 +2681,6 @@ finish_id_expression (tree id_expression, } else { - if (TREE_CODE (decl) == VAR_DECL - || TREE_CODE (decl) == PARM_DECL - || TREE_CODE (decl) == RESULT_DECL) - { - tree context = decl_function_context (decl); - - if (context != NULL_TREE && context != current_function_decl - && ! TREE_STATIC (decl)) - { - error ("use of %s from containing function", - (TREE_CODE (decl) == VAR_DECL - ? "`auto' variable" : "parameter")); - cp_error_at (" `%#D' declared here", decl); - return error_mark_node; - } - } - if (DECL_P (decl) && DECL_NONLOCAL (decl) && DECL_CLASS_SCOPE_P (decl) && DECL_CONTEXT (decl) != current_class_type) diff --git a/contrib/gcc-3.4/gcc/cp/typeck.c b/contrib/gcc-3.4/gcc/cp/typeck.c index e0f6868a6d..b13fb857d6 100644 --- a/contrib/gcc-3.4/gcc/cp/typeck.c +++ b/contrib/gcc-3.4/gcc/cp/typeck.c @@ -95,6 +95,9 @@ require_complete_type (tree value) else type = TREE_TYPE (value); + if (type == error_mark_node) + return error_mark_node; + /* First, detect a valid value with a complete type. */ if (COMPLETE_TYPE_P (type)) return value; @@ -4794,7 +4797,7 @@ build_const_cast (tree type, tree expr) { tree intype; - if (type == error_mark_node || expr == error_mark_node) + if (type == error_mark_node || error_operand_p (expr)) return error_mark_node; if (processing_template_decl) @@ -6084,6 +6087,15 @@ check_return_expr (tree retval) /* Remember that this function did return a value. */ current_function_returns_value = 1; + /* Check for erroneous operands -- but after giving ourselves a + chance to provide an error about returning a value from a void + function. */ + if (error_operand_p (retval)) + { + current_function_return_value = error_mark_node; + return error_mark_node; + } + /* Only operator new(...) throw(), can return NULL [expr.new/13]. */ if ((DECL_OVERLOADED_OPERATOR_P (current_function_decl) == NEW_EXPR || DECL_OVERLOADED_OPERATOR_P (current_function_decl) == VEC_NEW_EXPR) @@ -6140,8 +6152,8 @@ check_return_expr (tree retval) /* We don't need to do any conversions when there's nothing being returned. */ - if (!retval || retval == error_mark_node) - return retval; + if (!retval) + return NULL_TREE; /* Do any required conversions. */ if (retval == result || DECL_CONSTRUCTOR_P (current_function_decl)) diff --git a/contrib/gcc-3.4/gcc/cppfiles.c b/contrib/gcc-3.4/gcc/cppfiles.c index 9aea34c4b3..04f1a166b2 100644 --- a/contrib/gcc-3.4/gcc/cppfiles.c +++ b/contrib/gcc-3.4/gcc/cppfiles.c @@ -164,7 +164,7 @@ static bool should_stack_file (cpp_reader *, _cpp_file *file, bool import); static struct cpp_dir *search_path_head (cpp_reader *, const char *fname, int angle_brackets, enum include_type); static const char *dir_name_of_file (_cpp_file *file); -static void open_file_failed (cpp_reader *pfile, _cpp_file *file); +static void open_file_failed (cpp_reader *pfile, _cpp_file *file, int); static struct file_hash_entry *search_cache (struct file_hash_entry *head, const cpp_dir *start_dir); static _cpp_file *make_cpp_file (cpp_reader *, cpp_dir *, const char *fname); @@ -330,7 +330,7 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch) if (file->err_no != ENOENT) { - open_file_failed (pfile, file); + open_file_failed (pfile, file, 0); return true; } @@ -360,7 +360,7 @@ _cpp_find_failed (_cpp_file *file) to open_file(). */ _cpp_file * -_cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool fake) +_cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool fake, int angle_brackets) { struct file_hash_entry *entry, **hash_slot; _cpp_file *file; @@ -391,7 +391,7 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool f file->dir = file->dir->next; if (file->dir == NULL) { - open_file_failed (pfile, file); + open_file_failed (pfile, file, angle_brackets); if (invalid_pch) { cpp_error (pfile, CPP_DL_ERROR, @@ -533,7 +533,7 @@ read_file (cpp_reader *pfile, _cpp_file *file) if (file->fd == -1 && !open_file (file)) { - open_file_failed (pfile, file); + open_file_failed (pfile, file, 0); return false; } @@ -757,16 +757,17 @@ _cpp_stack_include (cpp_reader *pfile, const char *fname, int angle_brackets, if (!dir) return false; - return _cpp_stack_file (pfile, _cpp_find_file (pfile, fname, dir, false), + return _cpp_stack_file (pfile, _cpp_find_file (pfile, fname, dir, false, + angle_brackets), type == IT_IMPORT); } /* Could not open FILE. The complication is dependency output. */ static void -open_file_failed (cpp_reader *pfile, _cpp_file *file) +open_file_failed (cpp_reader *pfile, _cpp_file *file, int angle_brackets) { int sysp = pfile->map ? pfile->map->sysp: 0; - bool print_dep = CPP_OPTION (pfile, deps.style) > !!sysp; + bool print_dep = CPP_OPTION (pfile, deps.style) > (angle_brackets || !!sysp); errno = file->err_no; if (print_dep && CPP_OPTION (pfile, deps.missing_files) && errno == ENOENT) @@ -948,7 +949,7 @@ _cpp_cleanup_files (cpp_reader *pfile) void _cpp_fake_include (cpp_reader *pfile, const char *fname) { - _cpp_find_file (pfile, fname, pfile->buffer->file->dir, true); + _cpp_find_file (pfile, fname, pfile->buffer->file->dir, true, 0); } /* Not everyone who wants to set system-header-ness on a buffer can @@ -1030,7 +1031,7 @@ _cpp_compare_file_date (cpp_reader *pfile, const char *fname, if (!dir) return -1; - file = _cpp_find_file (pfile, fname, dir, false); + file = _cpp_find_file (pfile, fname, dir, false, angle_brackets); if (file->err_no) return -1; @@ -1070,6 +1071,7 @@ _cpp_pop_file_buffer (cpp_reader *pfile, _cpp_file *file) { free ((void *) file->buffer); file->buffer = NULL; + file->buffer_valid = false; } } diff --git a/contrib/gcc-3.4/gcc/cpphash.h b/contrib/gcc-3.4/gcc/cpphash.h index e30cdcad63..8c814b90fb 100644 --- a/contrib/gcc-3.4/gcc/cpphash.h +++ b/contrib/gcc-3.4/gcc/cpphash.h @@ -516,7 +516,7 @@ extern void _cpp_destroy_hashtable (cpp_reader *); /* In cppfiles.c */ typedef struct _cpp_file _cpp_file; extern _cpp_file *_cpp_find_file (cpp_reader *, const char *fname, - cpp_dir *start_dir, bool fake); + cpp_dir *start_dir, bool fake, int); extern bool _cpp_find_failed (_cpp_file *); extern void _cpp_mark_file_once_only (cpp_reader *, struct _cpp_file *); extern void _cpp_fake_include (cpp_reader *, const char *); diff --git a/contrib/gcc-3.4/gcc/cppinit.c b/contrib/gcc-3.4/gcc/cppinit.c index ae30568699..647fbbf5f5 100644 --- a/contrib/gcc-3.4/gcc/cppinit.c +++ b/contrib/gcc-3.4/gcc/cppinit.c @@ -466,7 +466,7 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname) } pfile->main_file - = _cpp_find_file (pfile, fname, &pfile->no_search_path, false); + = _cpp_find_file (pfile, fname, &pfile->no_search_path, false, 0); if (_cpp_find_failed (pfile->main_file)) return NULL; @@ -477,6 +477,8 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname) if (CPP_OPTION (pfile, preprocessed)) { read_original_filename (pfile); + if (!pfile->map) + return NULL; fname = pfile->map->to_file; } return fname; @@ -496,8 +498,10 @@ read_original_filename (cpp_reader *pfile) token = _cpp_lex_direct (pfile); if (token->type == CPP_HASH) { + pfile->state.in_directive = 1; token1 = _cpp_lex_direct (pfile); _cpp_backup_tokens (pfile, 1); + pfile->state.in_directive = 0; /* If it's a #line directive, handle it. */ if (token1->type == CPP_NUMBER) diff --git a/contrib/gcc-3.4/gcc/cse.c b/contrib/gcc-3.4/gcc/cse.c index 447d972c34..72af39aa4f 100644 --- a/contrib/gcc-3.4/gcc/cse.c +++ b/contrib/gcc-3.4/gcc/cse.c @@ -3518,6 +3518,9 @@ fold_rtx (rtx x, rtx insn) addr = addr_ent->const_rtx; } + /* Call target hook to avoid the effects of -fpic etc.... */ + addr = targetm.delegitimize_address (addr); + /* If address is constant, split it into a base and integer offset. */ if (GET_CODE (addr) == SYMBOL_REF || GET_CODE (addr) == LABEL_REF) base = addr; diff --git a/contrib/gcc-3.4/gcc/doc/contrib.texi b/contrib/gcc-3.4/gcc/doc/contrib.texi index 8c2419377e..3a279cd44a 100644 --- a/contrib/gcc-3.4/gcc/doc/contrib.texi +++ b/contrib/gcc-3.4/gcc/doc/contrib.texi @@ -269,9 +269,12 @@ Ivan Fontes Garcia for the Portugese translation of the GCJ FAQ. Peter Gerwinski for various bug fixes and the Pascal front end. @item -Kaveh Ghazi for his direction via the steering committee, -amazing work to make @samp{-W -Wall} useful, and continuously testing -GCC on a plethora of platforms. +Kaveh R.@: Ghazi for his direction via the steering committee, amazing +work to make @samp{-W -Wall -W* -Werror} useful, and continuously +testing GCC on a plethora of platforms. Kaveh extends his gratitude to +the @uref{http://www.caip.rutgers.edu,,CAIP Center} at Rutgers +University for providing him with computing resources to work on Free +Software since the late 1980s. @item John Gilmore for a donation to the FSF earmarked improving GNU Java. diff --git a/contrib/gcc-3.4/gcc/doc/cpp.1 b/contrib/gcc-3.4/gcc/doc/cpp.1 new file mode 100644 index 0000000000..17fdd0136c --- /dev/null +++ b/contrib/gcc-3.4/gcc/doc/cpp.1 @@ -0,0 +1,918 @@ +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to +.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' +.\" expand to `' in nroff, nothing in troff, for use with C<>. +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "CPP 1" +.TH CPP 1 "2006-03-06" "gcc-3.4.6" "GNU" +.SH "NAME" +cpp \- The C Preprocessor +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +cpp [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR] + [\fB\-I\fR\fIdir\fR...] [\fB\-W\fR\fIwarn\fR...] + [\fB\-M\fR|\fB\-MM\fR] [\fB\-MG\fR] [\fB\-MF\fR \fIfilename\fR] + [\fB\-MP\fR] [\fB\-MQ\fR \fItarget\fR...] + [\fB\-MT\fR \fItarget\fR...] + [\fB\-P\fR] [\fB\-fno\-working\-directory\fR] + [\fB\-x\fR \fIlanguage\fR] [\fB\-std=\fR\fIstandard\fR] + \fIinfile\fR \fIoutfile\fR +.PP +Only the most useful options are listed here; see below for the remainder. +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The C preprocessor, often known as \fIcpp\fR, is a \fImacro processor\fR +that is used automatically by the C compiler to transform your program +before compilation. It is called a macro processor because it allows +you to define \fImacros\fR, which are brief abbreviations for longer +constructs. +.PP +The C preprocessor is intended to be used only with C, \*(C+, and +Objective-C source code. In the past, it has been abused as a general +text processor. It will choke on input which does not obey C's lexical +rules. For example, apostrophes will be interpreted as the beginning of +character constants, and cause errors. Also, you cannot rely on it +preserving characteristics of the input which are not significant to +C\-family languages. If a Makefile is preprocessed, all the hard tabs +will be removed, and the Makefile will not work. +.PP +Having said that, you can often get away with using cpp on things which +are not C. Other Algol-ish programming languages are often safe +(Pascal, Ada, etc.) So is assembly, with caution. \fB\-traditional\-cpp\fR +mode preserves more white space, and is otherwise more permissive. Many +of the problems can be avoided by writing C or \*(C+ style comments +instead of native language comments, and keeping macros simple. +.PP +Wherever possible, you should use a preprocessor geared to the language +you are writing in. Modern versions of the \s-1GNU\s0 assembler have macro +facilities. Most high level programming languages have their own +conditional compilation and inclusion mechanism. If all else fails, +try a true general text processor, such as \s-1GNU\s0 M4. +.PP +C preprocessors vary in some details. This manual discusses the \s-1GNU\s0 C +preprocessor, which provides a small superset of the features of \s-1ISO\s0 +Standard C. In its default mode, the \s-1GNU\s0 C preprocessor does not do a +few things required by the standard. These are features which are +rarely, if ever, used, and may cause surprising changes to the meaning +of a program which does not expect them. To get strict \s-1ISO\s0 Standard C, +you should use the \fB\-std=c89\fR or \fB\-std=c99\fR options, depending +on which version of the standard you want. To get all the mandatory +diagnostics, you must also use \fB\-pedantic\fR. +.PP +This manual describes the behavior of the \s-1ISO\s0 preprocessor. To +minimize gratuitous differences, where the \s-1ISO\s0 preprocessor's +behavior does not conflict with traditional semantics, the +traditional preprocessor should behave the same way. The various +differences that do exist are detailed in the section \fBTraditional +Mode\fR. +.PP +For clarity, unless noted otherwise, references to \fB\s-1CPP\s0\fR in this +manual refer to \s-1GNU\s0 \s-1CPP\s0. +.SH "OPTIONS" +.IX Header "OPTIONS" +The C preprocessor expects two file names as arguments, \fIinfile\fR and +\&\fIoutfile\fR. The preprocessor reads \fIinfile\fR together with any +other files it specifies with \fB#include\fR. All the output generated +by the combined input files is written in \fIoutfile\fR. +.PP +Either \fIinfile\fR or \fIoutfile\fR may be \fB\-\fR, which as +\&\fIinfile\fR means to read from standard input and as \fIoutfile\fR +means to write to standard output. Also, if either file is omitted, it +means the same as if \fB\-\fR had been specified for that file. +.PP +Unless otherwise noted, or the option ends in \fB=\fR, all options +which take an argument may have that argument appear either immediately +after the option, or with a space between option and argument: +\&\fB\-Ifoo\fR and \fB\-I foo\fR have the same effect. +.PP +Many options have multi-letter names; therefore multiple single-letter +options may \fInot\fR be grouped: \fB\-dM\fR is very different from +\&\fB\-d\ \-M\fR. +.IP "\fB\-D\fR \fIname\fR" 4 +.IX Item "-D name" +Predefine \fIname\fR as a macro, with definition \f(CW1\fR. +.IP "\fB\-D\fR \fIname\fR\fB=\fR\fIdefinition\fR" 4 +.IX Item "-D name=definition" +Predefine \fIname\fR as a macro, with definition \fIdefinition\fR. +The contents of \fIdefinition\fR are tokenized and processed as if +they appeared during translation phase three in a \fB#define\fR +directive. In particular, the definition will be truncated by +embedded newline characters. +.Sp +If you are invoking the preprocessor from a shell or shell-like +program you may need to use the shell's quoting syntax to protect +characters such as spaces that have a meaning in the shell syntax. +.Sp +If you wish to define a function-like macro on the command line, write +its argument list with surrounding parentheses before the equals sign +(if any). Parentheses are meaningful to most shells, so you will need +to quote the option. With \fBsh\fR and \fBcsh\fR, +\&\fB\-D'\fR\fIname\fR\fB(\fR\fIargs...\fR\fB)=\fR\fIdefinition\fR\fB'\fR works. +.Sp +\&\fB\-D\fR and \fB\-U\fR options are processed in the order they +are given on the command line. All \fB\-imacros\fR \fIfile\fR and +\&\fB\-include\fR \fIfile\fR options are processed after all +\&\fB\-D\fR and \fB\-U\fR options. +.IP "\fB\-U\fR \fIname\fR" 4 +.IX Item "-U name" +Cancel any previous definition of \fIname\fR, either built in or +provided with a \fB\-D\fR option. +.IP "\fB\-undef\fR" 4 +.IX Item "-undef" +Do not predefine any system-specific or GCC-specific macros. The +standard predefined macros remain defined. +.IP "\fB\-I\fR \fIdir\fR" 4 +.IX Item "-I dir" +Add the directory \fIdir\fR to the list of directories to be searched +for header files. +.Sp +Directories named by \fB\-I\fR are searched before the standard +system include directories. If the directory \fIdir\fR is a standard +system include directory, the option is ignored to ensure that the +default search order for system directories and the special treatment +of system headers are not defeated +\&. +.IP "\fB\-o\fR \fIfile\fR" 4 +.IX Item "-o file" +Write output to \fIfile\fR. This is the same as specifying \fIfile\fR +as the second non-option argument to \fBcpp\fR. \fBgcc\fR has a +different interpretation of a second non-option argument, so you must +use \fB\-o\fR to specify the output file. +.IP "\fB\-Wall\fR" 4 +.IX Item "-Wall" +Turns on all optional warnings which are desirable for normal code. +At present this is \fB\-Wcomment\fR, \fB\-Wtrigraphs\fR, +\&\fB\-Wmultichar\fR and a warning about integer promotion causing a +change of sign in \f(CW\*(C`#if\*(C'\fR expressions. Note that many of the +preprocessor's warnings are on by default and have no options to +control them. +.IP "\fB\-Wcomment\fR" 4 +.IX Item "-Wcomment" +.PD 0 +.IP "\fB\-Wcomments\fR" 4 +.IX Item "-Wcomments" +.PD +Warn whenever a comment-start sequence \fB/*\fR appears in a \fB/*\fR +comment, or whenever a backslash-newline appears in a \fB//\fR comment. +(Both forms have the same effect.) +.IP "\fB\-Wtrigraphs\fR" 4 +.IX Item "-Wtrigraphs" +@anchor{Wtrigraphs} +Most trigraphs in comments cannot affect the meaning of the program. +However, a trigraph that would form an escaped newline (\fB??/\fR at +the end of a line) can, by changing where the comment begins or ends. +Therefore, only trigraphs that would form escaped newlines produce +warnings inside a comment. +.Sp +This option is implied by \fB\-Wall\fR. If \fB\-Wall\fR is not +given, this option is still enabled unless trigraphs are enabled. To +get trigraph conversion without warnings, but get the other +\&\fB\-Wall\fR warnings, use \fB\-trigraphs \-Wall \-Wno\-trigraphs\fR. +.IP "\fB\-Wtraditional\fR" 4 +.IX Item "-Wtraditional" +Warn about certain constructs that behave differently in traditional and +\&\s-1ISO\s0 C. Also warn about \s-1ISO\s0 C constructs that have no traditional C +equivalent, and problematic constructs which should be avoided. +.IP "\fB\-Wimport\fR" 4 +.IX Item "-Wimport" +Warn the first time \fB#import\fR is used. +.IP "\fB\-Wundef\fR" 4 +.IX Item "-Wundef" +Warn whenever an identifier which is not a macro is encountered in an +\&\fB#if\fR directive, outside of \fBdefined\fR. Such identifiers are +replaced with zero. +.IP "\fB\-Wunused\-macros\fR" 4 +.IX Item "-Wunused-macros" +Warn about macros defined in the main file that are unused. A macro +is \fIused\fR 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. +.Sp +Built-in macros, macros defined on the command line, and macros +defined in include files are not warned about. +.Sp +\&\fBNote:\fR If a macro is actually used, but only used in skipped +conditional blocks, then \s-1CPP\s0 will report it as unused. To avoid the +warning in such a case, you might improve the scope of the macro's +definition by, for example, moving it into the first skipped block. +Alternatively, you could provide a dummy use with something like: +.Sp +.Vb 2 +\& #if defined the_macro_causing_the_warning +\& #endif +.Ve +.IP "\fB\-Wendif\-labels\fR" 4 +.IX Item "-Wendif-labels" +Warn whenever an \fB#else\fR or an \fB#endif\fR are followed by text. +This usually happens in code of the form +.Sp +.Vb 5 +\& #if FOO +\& ... +\& #else FOO +\& ... +\& #endif FOO +.Ve +.Sp +The second and third \f(CW\*(C`FOO\*(C'\fR should be in comments, but often are not +in older programs. This warning is on by default. +.IP "\fB\-Werror\fR" 4 +.IX Item "-Werror" +Make all warnings into hard errors. Source code which triggers warnings +will be rejected. +.IP "\fB\-Wsystem\-headers\fR" 4 +.IX Item "-Wsystem-headers" +Issue warnings for code in system headers. These are normally unhelpful +in finding bugs in your own code, therefore suppressed. If you are +responsible for the system library, you may want to see them. +.IP "\fB\-w\fR" 4 +.IX Item "-w" +Suppress all warnings, including those which \s-1GNU\s0 \s-1CPP\s0 issues by default. +.IP "\fB\-pedantic\fR" 4 +.IX Item "-pedantic" +Issue all the mandatory diagnostics listed in the C standard. Some of +them are left out by default, since they trigger frequently on harmless +code. +.IP "\fB\-pedantic\-errors\fR" 4 +.IX Item "-pedantic-errors" +Issue all the mandatory diagnostics, and make all mandatory diagnostics +into errors. This includes mandatory diagnostics that \s-1GCC\s0 issues +without \fB\-pedantic\fR but treats as warnings. +.IP "\fB\-M\fR" 4 +.IX Item "-M" +Instead of outputting the result of preprocessing, output a rule +suitable for \fBmake\fR describing the dependencies of the main +source file. The preprocessor outputs one \fBmake\fR rule containing +the object file name for that source file, a colon, and the names of all +the included files, including those coming from \fB\-include\fR or +\&\fB\-imacros\fR command line options. +.Sp +Unless specified explicitly (with \fB\-MT\fR or \fB\-MQ\fR), the +object file name consists of the basename of the source file with any +suffix replaced with object file suffix. If there are many included +files then the rule is split into several lines using \fB\e\fR\-newline. +The rule has no commands. +.Sp +This option does not suppress the preprocessor's debug output, such as +\&\fB\-dM\fR. To avoid mixing such debug output with the dependency +rules you should explicitly specify the dependency output file with +\&\fB\-MF\fR, or use an environment variable like +\&\fB\s-1DEPENDENCIES_OUTPUT\s0\fR. Debug output +will still be sent to the regular output stream as normal. +.Sp +Passing \fB\-M\fR to the driver implies \fB\-E\fR, and suppresses +warnings with an implicit \fB\-w\fR. +.IP "\fB\-MM\fR" 4 +.IX Item "-MM" +Like \fB\-M\fR but do not mention header files that are found in +system header directories, nor header files that are included, +directly or indirectly, from such a header. +.Sp +This implies that the choice of angle brackets or double quotes in an +\&\fB#include\fR directive does not in itself determine whether that +header will appear in \fB\-MM\fR dependency output. This is a +slight change in semantics from \s-1GCC\s0 versions 3.0 and earlier. +.Sp +@anchor{dashMF} +.IP "\fB\-MF\fR \fIfile\fR" 4 +.IX Item "-MF file" +When used with \fB\-M\fR or \fB\-MM\fR, specifies a +file to write the dependencies to. If no \fB\-MF\fR switch is given +the preprocessor sends the rules to the same place it would have sent +preprocessed output. +.Sp +When used with the driver options \fB\-MD\fR or \fB\-MMD\fR, +\&\fB\-MF\fR overrides the default dependency output file. +.IP "\fB\-MG\fR" 4 +.IX Item "-MG" +In conjunction with an option such as \fB\-M\fR requesting +dependency generation, \fB\-MG\fR assumes missing header files are +generated files and adds them to the dependency list without raising +an error. The dependency filename is taken directly from the +\&\f(CW\*(C`#include\*(C'\fR directive without prepending any path. \fB\-MG\fR +also suppresses preprocessed output, as a missing header file renders +this useless. +.Sp +This feature is used in automatic updating of makefiles. +.IP "\fB\-MP\fR" 4 +.IX Item "-MP" +This option instructs \s-1CPP\s0 to add a phony target for each dependency +other than the main file, causing each to depend on nothing. These +dummy rules work around errors \fBmake\fR gives if you remove header +files without updating the \fIMakefile\fR to match. +.Sp +This is typical output: +.Sp +.Vb 1 +\& test.o: test.c test.h +.Ve +.Sp +.Vb 1 +\& test.h: +.Ve +.IP "\fB\-MT\fR \fItarget\fR" 4 +.IX Item "-MT target" +Change the target of the rule emitted by dependency generation. By +default \s-1CPP\s0 takes the name of the main input file, including any path, +deletes any file suffix such as \fB.c\fR, and appends the platform's +usual object suffix. The result is the target. +.Sp +An \fB\-MT\fR option will set the target to be exactly the string you +specify. If you want multiple targets, you can specify them as a single +argument to \fB\-MT\fR, or use multiple \fB\-MT\fR options. +.Sp +For example, \fB\-MT\ '$(objpfx)foo.o'\fR might give +.Sp +.Vb 1 +\& $(objpfx)foo.o: foo.c +.Ve +.IP "\fB\-MQ\fR \fItarget\fR" 4 +.IX Item "-MQ target" +Same as \fB\-MT\fR, but it quotes any characters which are special to +Make. \fB\-MQ\ '$(objpfx)foo.o'\fR gives +.Sp +.Vb 1 +\& $$(objpfx)foo.o: foo.c +.Ve +.Sp +The default target is automatically quoted, as if it were given with +\&\fB\-MQ\fR. +.IP "\fB\-MD\fR" 4 +.IX Item "-MD" +\&\fB\-MD\fR is equivalent to \fB\-M \-MF\fR \fIfile\fR, except that +\&\fB\-E\fR is not implied. The driver determines \fIfile\fR based on +whether an \fB\-o\fR option is given. If it is, the driver uses its +argument but with a suffix of \fI.d\fR, otherwise it take the +basename of the input file and applies a \fI.d\fR suffix. +.Sp +If \fB\-MD\fR is used in conjunction with \fB\-E\fR, any +\&\fB\-o\fR switch is understood to specify the dependency output file +(but \f(CW@pxref\fR{dashMF,,\-MF}), but if used without \fB\-E\fR, each \fB\-o\fR +is understood to specify a target object file. +.Sp +Since \fB\-E\fR is not implied, \fB\-MD\fR can be used to generate +a dependency output file as a side-effect of the compilation process. +.IP "\fB\-MMD\fR" 4 +.IX Item "-MMD" +Like \fB\-MD\fR except mention only user header files, not system +\&\-header files. +.IP "\fB\-x c\fR" 4 +.IX Item "-x c" +.PD 0 +.IP "\fB\-x c++\fR" 4 +.IX Item "-x c++" +.IP "\fB\-x objective-c\fR" 4 +.IX Item "-x objective-c" +.IP "\fB\-x assembler-with-cpp\fR" 4 +.IX Item "-x assembler-with-cpp" +.PD +Specify the source language: C, \*(C+, Objective\-C, or assembly. This has +nothing to do with standards conformance or extensions; it merely +selects which base syntax to expect. If you give none of these options, +cpp will deduce the language from the extension of the source file: +\&\fB.c\fR, \fB.cc\fR, \fB.m\fR, or \fB.S\fR. Some other common +extensions for \*(C+ and assembly are also recognized. If cpp does not +recognize the extension, it will treat the file as C; this is the most +generic mode. +.Sp +\&\fBNote:\fR Previous versions of cpp accepted a \fB\-lang\fR option +which selected both the language and the standards conformance level. +This option has been removed, because it conflicts with the \fB\-l\fR +option. +.IP "\fB\-std=\fR\fIstandard\fR" 4 +.IX Item "-std=standard" +.PD 0 +.IP "\fB\-ansi\fR" 4 +.IX Item "-ansi" +.PD +Specify the standard to which the code should conform. Currently \s-1CPP\s0 +knows about C and \*(C+ standards; others may be added in the future. +.Sp +\&\fIstandard\fR +may be one of: +.RS 4 +.ie n .IP """iso9899:1990""" 4 +.el .IP "\f(CWiso9899:1990\fR" 4 +.IX Item "iso9899:1990" +.PD 0 +.ie n .IP """c89""" 4 +.el .IP "\f(CWc89\fR" 4 +.IX Item "c89" +.PD +The \s-1ISO\s0 C standard from 1990. \fBc89\fR is the customary shorthand for +this version of the standard. +.Sp +The \fB\-ansi\fR option is equivalent to \fB\-std=c89\fR. +.ie n .IP """iso9899:199409""" 4 +.el .IP "\f(CWiso9899:199409\fR" 4 +.IX Item "iso9899:199409" +The 1990 C standard, as amended in 1994. +.ie n .IP """iso9899:1999""" 4 +.el .IP "\f(CWiso9899:1999\fR" 4 +.IX Item "iso9899:1999" +.PD 0 +.ie n .IP """c99""" 4 +.el .IP "\f(CWc99\fR" 4 +.IX Item "c99" +.ie n .IP """iso9899:199x""" 4 +.el .IP "\f(CWiso9899:199x\fR" 4 +.IX Item "iso9899:199x" +.ie n .IP """c9x""" 4 +.el .IP "\f(CWc9x\fR" 4 +.IX Item "c9x" +.PD +The revised \s-1ISO\s0 C standard, published in December 1999. Before +publication, this was known as C9X. +.ie n .IP """gnu89""" 4 +.el .IP "\f(CWgnu89\fR" 4 +.IX Item "gnu89" +The 1990 C standard plus \s-1GNU\s0 extensions. This is the default. +.ie n .IP """gnu99""" 4 +.el .IP "\f(CWgnu99\fR" 4 +.IX Item "gnu99" +.PD 0 +.ie n .IP """gnu9x""" 4 +.el .IP "\f(CWgnu9x\fR" 4 +.IX Item "gnu9x" +.PD +The 1999 C standard plus \s-1GNU\s0 extensions. +.ie n .IP """c++98""" 4 +.el .IP "\f(CWc++98\fR" 4 +.IX Item "c++98" +The 1998 \s-1ISO\s0 \*(C+ standard plus amendments. +.ie n .IP """gnu++98""" 4 +.el .IP "\f(CWgnu++98\fR" 4 +.IX Item "gnu++98" +The same as \fB\-std=c++98\fR plus \s-1GNU\s0 extensions. This is the +default for \*(C+ code. +.RE +.RS 4 +.RE +.IP "\fB\-I\-\fR" 4 +.IX Item "-I-" +Split the include path. Any directories specified with \fB\-I\fR +options before \fB\-I\-\fR are searched only for headers requested with +\&\f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR; they are not searched for +\&\f(CW\*(C`#include\ <\f(CIfile\f(CW>\*(C'\fR. If additional directories are +specified with \fB\-I\fR options after the \fB\-I\-\fR, those +directories are searched for all \fB#include\fR directives. +.Sp +In addition, \fB\-I\-\fR inhibits the use of the directory of the current +file directory as the first search directory for \f(CW\*(C`#include\ "\f(CIfile\f(CW"\*(C'\fR. +.IP "\fB\-nostdinc\fR" 4 +.IX Item "-nostdinc" +Do not search the standard system directories for header files. +Only the directories you have specified with \fB\-I\fR options +(and the directory of the current file, if appropriate) are searched. +.IP "\fB\-nostdinc++\fR" 4 +.IX Item "-nostdinc++" +Do not search for header files in the \*(C+\-specific standard directories, +but do still search the other standard directories. (This option is +used when building the \*(C+ library.) +.IP "\fB\-include\fR \fIfile\fR" 4 +.IX Item "-include file" +Process \fIfile\fR as if \f(CW\*(C`#include "file"\*(C'\fR appeared as the first +line of the primary source file. However, the first directory searched +for \fIfile\fR is the preprocessor's working directory \fIinstead of\fR +the directory containing the main source file. If not found there, it +is searched for in the remainder of the \f(CW\*(C`#include "..."\*(C'\fR search +chain as normal. +.Sp +If multiple \fB\-include\fR options are given, the files are included +in the order they appear on the command line. +.IP "\fB\-imacros\fR \fIfile\fR" 4 +.IX Item "-imacros file" +Exactly like \fB\-include\fR, except that any output produced by +scanning \fIfile\fR is thrown away. Macros it defines remain defined. +This allows you to acquire all the macros from a header without also +processing its declarations. +.Sp +All files specified by \fB\-imacros\fR are processed before all files +specified by \fB\-include\fR. +.IP "\fB\-idirafter\fR \fIdir\fR" 4 +.IX Item "-idirafter dir" +Search \fIdir\fR for header files, but do it \fIafter\fR all +directories specified with \fB\-I\fR and the standard system directories +have been exhausted. \fIdir\fR is treated as a system include directory. +.IP "\fB\-iprefix\fR \fIprefix\fR" 4 +.IX Item "-iprefix prefix" +Specify \fIprefix\fR as the prefix for subsequent \fB\-iwithprefix\fR +options. If the prefix represents a directory, you should include the +final \fB/\fR. +.IP "\fB\-iwithprefix\fR \fIdir\fR" 4 +.IX Item "-iwithprefix dir" +.PD 0 +.IP "\fB\-iwithprefixbefore\fR \fIdir\fR" 4 +.IX Item "-iwithprefixbefore dir" +.PD +Append \fIdir\fR to the prefix specified previously with +\&\fB\-iprefix\fR, and add the resulting directory to the include search +path. \fB\-iwithprefixbefore\fR puts it in the same place \fB\-I\fR +would; \fB\-iwithprefix\fR puts it where \fB\-idirafter\fR would. +.IP "\fB\-isystem\fR \fIdir\fR" 4 +.IX Item "-isystem dir" +Search \fIdir\fR for header files, after all directories specified by +\&\fB\-I\fR but before the standard system directories. Mark it +as a system directory, so that it gets the same special treatment as +is applied to the standard system directories. +.IP "\fB\-fdollars\-in\-identifiers\fR" 4 +.IX Item "-fdollars-in-identifiers" +@anchor{fdollars\-in\-identifiers} +Accept \fB$\fR in identifiers. +.IP "\fB\-fpreprocessed\fR" 4 +.IX Item "-fpreprocessed" +Indicate to the preprocessor that the input file has already been +preprocessed. This suppresses things like macro expansion, trigraph +conversion, escaped newline splicing, and processing of most directives. +The preprocessor still recognizes and removes comments, so that you can +pass a file preprocessed with \fB\-C\fR to the compiler without +problems. In this mode the integrated preprocessor is little more than +a tokenizer for the front ends. +.Sp +\&\fB\-fpreprocessed\fR is implicit if the input file has one of the +extensions \fB.i\fR, \fB.ii\fR or \fB.mi\fR. These are the +extensions that \s-1GCC\s0 uses for preprocessed files created by +\&\fB\-save\-temps\fR. +.IP "\fB\-ftabstop=\fR\fIwidth\fR" 4 +.IX Item "-ftabstop=width" +Set the distance between tab stops. This helps the preprocessor report +correct column numbers in warnings or errors, even if tabs appear on the +line. If the value is less than 1 or greater than 100, the option is +ignored. The default is 8. +.IP "\fB\-fexec\-charset=\fR\fIcharset\fR" 4 +.IX Item "-fexec-charset=charset" +Set the execution character set, used for string and character +constants. The default is \s-1UTF\-8\s0. \fIcharset\fR can be any encoding +supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine. +.IP "\fB\-fwide\-exec\-charset=\fR\fIcharset\fR" 4 +.IX Item "-fwide-exec-charset=charset" +Set the wide execution character set, used for wide string and +character constants. The default is \s-1UTF\-32\s0 or \s-1UTF\-16\s0, whichever +corresponds to the width of \f(CW\*(C`wchar_t\*(C'\fR. As with +\&\fB\-ftarget\-charset\fR, \fIcharset\fR can be any encoding supported +by the system's \f(CW\*(C`iconv\*(C'\fR library routine; however, you will have +problems with encodings that do not fit exactly in \f(CW\*(C`wchar_t\*(C'\fR. +.IP "\fB\-finput\-charset=\fR\fIcharset\fR" 4 +.IX Item "-finput-charset=charset" +Set the input character set, used for translation from the character +set of the input file to the source character set used by \s-1GCC\s0. If the +locale does not specify, or \s-1GCC\s0 cannot get this information from the +locale, the default is \s-1UTF\-8\s0. This can be overridden by either the locale +or this command line option. Currently the command line option takes +precedence if there's a conflict. \fIcharset\fR can be any encoding +supported by the system's \f(CW\*(C`iconv\*(C'\fR library routine. +.IP "\fB\-fworking\-directory\fR" 4 +.IX Item "-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 preprocessor will +emit, after the initial linemarker, a second linemarker with the +current working directory followed by two slashes. \s-1GCC\s0 will use this +directory, when it's present in the preprocessed input, as the +directory emitted as the current working directory in some debugging +information formats. This option is implicitly enabled if debugging +information is enabled, but this can be inhibited with the negated +form \fB\-fno\-working\-directory\fR. If the \fB\-P\fR flag is +present in the command line, this option has no effect, since no +\&\f(CW\*(C`#line\*(C'\fR directives are emitted whatsoever. +.IP "\fB\-fno\-show\-column\fR" 4 +.IX Item "-fno-show-column" +Do not print column numbers in diagnostics. This may be necessary if +diagnostics are being scanned by a program that does not understand the +column numbers, such as \fBdejagnu\fR. +.IP "\fB\-A\fR \fIpredicate\fR\fB=\fR\fIanswer\fR" 4 +.IX Item "-A predicate=answer" +Make an assertion with the predicate \fIpredicate\fR and answer +\&\fIanswer\fR. This form is preferred to the older form \fB\-A\fR +\&\fIpredicate\fR\fB(\fR\fIanswer\fR\fB)\fR, which is still supported, because +it does not use shell special characters. +.IP "\fB\-A \-\fR\fIpredicate\fR\fB=\fR\fIanswer\fR" 4 +.IX Item "-A -predicate=answer" +Cancel an assertion with the predicate \fIpredicate\fR and answer +\&\fIanswer\fR. +.IP "\fB\-dCHARS\fR" 4 +.IX Item "-dCHARS" +\&\fI\s-1CHARS\s0\fR is a sequence of one or more of the following characters, +and must not be preceded by a space. Other characters are interpreted +by the compiler proper, or reserved for future versions of \s-1GCC\s0, and so +are silently ignored. If you specify characters whose behavior +conflicts, the result is undefined. +.RS 4 +.IP "\fBM\fR" 4 +.IX Item "M" +Instead of the normal output, generate a list of \fB#define\fR +directives for all the macros defined during the execution of the +preprocessor, including predefined macros. This gives you a way of +finding out what is predefined in your version of the preprocessor. +Assuming you have no file \fIfoo.h\fR, the command +.Sp +.Vb 1 +\& touch foo.h; cpp -dM foo.h +.Ve +.Sp +will show all the predefined macros. +.IP "\fBD\fR" 4 +.IX Item "D" +Like \fBM\fR except in two respects: it does \fInot\fR include the +predefined macros, and it outputs \fIboth\fR the \fB#define\fR +directives and the result of preprocessing. Both kinds of output go to +the standard output file. +.IP "\fBN\fR" 4 +.IX Item "N" +Like \fBD\fR, but emit only the macro names, not their expansions. +.IP "\fBI\fR" 4 +.IX Item "I" +Output \fB#include\fR directives in addition to the result of +preprocessing. +.RE +.RS 4 +.RE +.IP "\fB\-P\fR" 4 +.IX Item "-P" +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. +.IP "\fB\-C\fR" 4 +.IX Item "-C" +Do not discard comments. All comments are passed through to the output +file, except for comments in processed directives, which are deleted +along with the directive. +.Sp +You should be prepared for side effects when using \fB\-C\fR; it +causes the preprocessor to treat comments as tokens in their own right. +For example, comments appearing at the start of what would be a +directive line have the effect of turning that line into an ordinary +source line, since the first token on the line is no longer a \fB#\fR. +.IP "\fB\-CC\fR" 4 +.IX Item "-CC" +Do not discard comments, including during macro expansion. This is +like \fB\-C\fR, except that comments contained within macros are +also passed through to the output file where the macro is expanded. +.Sp +In addition to the side-effects of the \fB\-C\fR option, the +\&\fB\-CC\fR option causes all \*(C+\-style comments inside a macro +to be converted to C\-style comments. This is to prevent later use +of that macro from inadvertently commenting out the remainder of +the source line. +.Sp +The \fB\-CC\fR option is generally used to support lint comments. +.IP "\fB\-traditional\-cpp\fR" 4 +.IX Item "-traditional-cpp" +Try to imitate the behavior of old-fashioned C preprocessors, as +opposed to \s-1ISO\s0 C preprocessors. +.IP "\fB\-trigraphs\fR" 4 +.IX Item "-trigraphs" +Process trigraph sequences. +.IP "\fB\-remap\fR" 4 +.IX Item "-remap" +Enable special code to work around file systems which only permit very +short file names, such as \s-1MS\-DOS\s0. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +.PD 0 +.IP "\fB\-\-target\-help\fR" 4 +.IX Item "--target-help" +.PD +Print text describing all the command line options instead of +preprocessing anything. +.IP "\fB\-v\fR" 4 +.IX Item "-v" +Verbose mode. Print out \s-1GNU\s0 \s-1CPP\s0's version number at the beginning of +execution, and report the final form of the include path. +.IP "\fB\-H\fR" 4 +.IX Item "-H" +Print the name of each header file used, in addition to other normal +activities. Each name is indented to show how deep in the +\&\fB#include\fR stack it is. Precompiled header files are also +printed, even if they are found to be invalid; an invalid precompiled +header file is printed with \fB...x\fR and a valid one with \fB...!\fR . +.IP "\fB\-version\fR" 4 +.IX Item "-version" +.PD 0 +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +.PD +Print out \s-1GNU\s0 \s-1CPP\s0's version number. With one dash, proceed to +preprocess as normal. With two dashes, exit immediately. +.SH "ENVIRONMENT" +.IX Header "ENVIRONMENT" +This section describes the environment variables that affect how \s-1CPP\s0 +operates. You can use them to specify directories or prefixes to use +when searching for include files, or to control dependency output. +.PP +Note that you can also specify places to search using options such as +\&\fB\-I\fR, and control dependency output with options like +\&\fB\-M\fR. These take precedence over +environment variables, which in turn take precedence over the +configuration of \s-1GCC\s0. +.IP "\fB\s-1CPATH\s0\fR" 4 +.IX Item "CPATH" +.PD 0 +.IP "\fBC_INCLUDE_PATH\fR" 4 +.IX Item "C_INCLUDE_PATH" +.IP "\fB\s-1CPLUS_INCLUDE_PATH\s0\fR" 4 +.IX Item "CPLUS_INCLUDE_PATH" +.IP "\fB\s-1OBJC_INCLUDE_PATH\s0\fR" 4 +.IX Item "OBJC_INCLUDE_PATH" +.PD +Each variable's value is a list of directories separated by a special +character, much like \fB\s-1PATH\s0\fR, in which to look for header files. +The special character, \f(CW\*(C`PATH_SEPARATOR\*(C'\fR, is target-dependent and +determined at \s-1GCC\s0 build time. For Microsoft Windows-based targets it is a +semicolon, and for almost all other targets it is a colon. +.Sp +\&\fB\s-1CPATH\s0\fR specifies a list of directories to be searched as if +specified with \fB\-I\fR, but after any paths given with \fB\-I\fR +options on the command line. This environment variable is used +regardless of which language is being preprocessed. +.Sp +The remaining environment variables apply only when preprocessing the +particular language indicated. Each specifies a list of directories +to be searched as if specified with \fB\-isystem\fR, but after any +paths given with \fB\-isystem\fR options on the command line. +.Sp +In all these variables, an empty element instructs the compiler to +search its current working directory. Empty elements can appear at the +beginning or end of a path. For instance, if the value of +\&\fB\s-1CPATH\s0\fR is \f(CW\*(C`:/special/include\*(C'\fR, that has the same +effect as \fB\-I.\ \-I/special/include\fR. +.IP "\fB\s-1DEPENDENCIES_OUTPUT\s0\fR" 4 +.IX Item "DEPENDENCIES_OUTPUT" +If this variable is set, its value specifies how to output +dependencies for Make based on the non-system header files processed +by the compiler. System header files are ignored in the dependency +output. +.Sp +The value of \fB\s-1DEPENDENCIES_OUTPUT\s0\fR can be just a file name, in +which case the Make rules are written to that file, guessing the target +name from the source file name. Or the value can have the form +\&\fIfile\fR\fB \fR\fItarget\fR, in which case the rules are written to +file \fIfile\fR using \fItarget\fR as the target name. +.Sp +In other words, this environment variable is equivalent to combining +the options \fB\-MM\fR and \fB\-MF\fR, +with an optional \fB\-MT\fR switch too. +.IP "\fB\s-1SUNPRO_DEPENDENCIES\s0\fR" 4 +.IX Item "SUNPRO_DEPENDENCIES" +This variable is the same as \fB\s-1DEPENDENCIES_OUTPUT\s0\fR (see above), +except that system header files are not ignored, so it implies +\&\fB\-M\fR rather than \fB\-MM\fR. However, the dependence on the +main input file is omitted. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fIgpl\fR\|(7), \fIgfdl\fR\|(7), \fIfsf\-funding\fR\|(7), +\&\fIgcc\fR\|(1), \fIas\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIcpp\fR, \fIgcc\fR, and +\&\fIbinutils\fR. +.SH "COPYRIGHT" +.IX Header "COPYRIGHT" +Copyright (c) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, +1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +Free Software Foundation, Inc. +.PP +Permission is granted to copy, distribute and/or modify this document +under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation. A copy of +the license is included in the +man page \fIgfdl\fR\|(7). +This manual contains no Invariant Sections. The Front-Cover Texts are +(a) (see below), and the Back-Cover Texts are (b) (see below). +.PP +(a) The \s-1FSF\s0's Front-Cover Text is: +.PP +.Vb 1 +\& A GNU Manual +.Ve +.PP +(b) The \s-1FSF\s0's Back-Cover Text is: +.PP +.Vb 3 +\& You have freedom to copy and modify this GNU Manual, like GNU +\& software. Copies published by the Free Software Foundation raise +\& funds for GNU development. +.Ve diff --git a/contrib/gcc-3.4/gcc/doc/g++.1 b/contrib/gcc-3.4/gcc/doc/g++.1 new file mode 100644 index 0000000000..1fd2c2bcea --- /dev/null +++ b/contrib/gcc-3.4/gcc/doc/g++.1 @@ -0,0 +1,10726 @@ +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to +.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' +.\" expand to `' in nroff, nothing in troff, for use with C<>. +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "GCC 1" +.TH GCC 1 "2006-03-06" "gcc-3.4.6" "GNU" +.SH "NAME" +gcc \- GNU project C and C++ compiler +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +gcc [\fB\-c\fR|\fB\-S\fR|\fB\-E\fR] [\fB\-std=\fR\fIstandard\fR] + [\fB\-g\fR] [\fB\-pg\fR] [\fB\-O\fR\fIlevel\fR] + [\fB\-W\fR\fIwarn\fR...] [\fB\-pedantic\fR] + [\fB\-I\fR\fIdir\fR...] [\fB\-L\fR\fIdir\fR...] + [\fB\-D\fR\fImacro\fR[=\fIdefn\fR]...] [\fB\-U\fR\fImacro\fR] + [\fB\-f\fR\fIoption\fR...] [\fB\-m\fR\fImachine-option\fR...] + [\fB\-o\fR \fIoutfile\fR] \fIinfile\fR... +.PP +Only the most useful options are listed here; see below for the +remainder. \fBg++\fR accepts mostly the same options as \fBgcc\fR. +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +When you invoke \s-1GCC\s0, it normally does preprocessing, compilation, +assembly and linking. The ``overall options'' allow you to stop this +process at an intermediate stage. For example, the \fB\-c\fR option +says not to run the linker. Then the output consists of object files +output by the assembler. +.PP +Other options are passed on to one stage of processing. Some options +control the preprocessor and others the compiler itself. Yet other +options control the assembler and linker; most of these are not +documented here, since you rarely need to use any of them. +.PP +Most of the command line options that you can use with \s-1GCC\s0 are useful +for C programs; when an option is only useful with another language +(usually \*(C+), the explanation says so explicitly. If the description +for a particular option does not mention a source language, you can use +that option with all supported languages. +.PP +The \fBgcc\fR program accepts options and file names as operands. Many +options have multi-letter names; therefore multiple single-letter options +may \fInot\fR be grouped: \fB\-dr\fR is very different from \fB\-d\ \-r\fR. +.PP +You can mix options and other arguments. For the most part, the order +you use doesn't matter. Order does matter when you use several options +of the same kind; for example, if you specify \fB\-L\fR more than once, +the directories are searched in the order specified. +.PP +Many options have long names starting with \fB\-f\fR or with +\&\fB\-W\fR\-\-\-for example, \fB\-fforce\-mem\fR, +\&\fB\-fstrength\-reduce\fR, \fB\-Wformat\fR and so on. Most of +these have both positive and negative forms; the negative form of +\&\fB\-ffoo\fR would be \fB\-fno\-foo\fR. This manual documents +only one of these two forms, whichever one is not the default. +.SH "OPTIONS" +.IX Header "OPTIONS" +.Sh "Option Summary" +.IX Subsection "Option Summary" +Here is a summary of all the options, grouped by type. Explanations are +in the following sections. +.IP "\fIOverall Options\fR" 4 +.IX Item "Overall Options" +\&\fB\-c \-S \-E \-o\fR \fIfile\fR \fB\-pipe \-pass\-exit\-codes +\&\-x\fR \fIlanguage\fR \fB\-v \-### \-\-help \-\-target\-help \-\-version\fR +.IP "\fIC Language Options\fR" 4 +.IX Item "C Language Options" +\&\fB\-ansi \-std=\fR\fIstandard\fR \fB\-aux\-info\fR \fIfilename\fR +\&\fB\-fno\-asm \-fno\-builtin \-fno\-builtin\-\fR\fIfunction\fR +\&\fB\-fhosted \-ffreestanding \-fms\-extensions +\&\-trigraphs \-no\-integrated\-cpp \-traditional \-traditional\-cpp +\&\-fallow\-single\-precision \-fcond\-mismatch +\&\-fsigned\-bitfields \-fsigned\-char +\&\-funsigned\-bitfields \-funsigned\-char +\&\-fwritable\-strings\fR +.IP "\fI\*(C+ Language Options\fR" 4 +.IX Item " Language Options" +\&\fB\-fabi\-version=\fR\fIn\fR \fB\-fno\-access\-control \-fcheck\-new +\&\-fconserve\-space \-fno\-const\-strings +\&\-fno\-elide\-constructors +\&\-fno\-enforce\-eh\-specs +\&\-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\-\fR\fIn\fR +\&\fB\-fuse\-cxa\-atexit \-fno\-weak \-nostdinc++ +\&\-fno\-default\-inline \-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\fR +.IP "\fIObjective-C Language Options\fR" 4 +.IX Item "Objective-C Language Options" +\&\fB\-fconstant\-string\-class=\fR\fIclass-name\fR +\&\fB\-fgnu\-runtime \-fnext\-runtime +\&\-fno\-nil\-receivers +\&\-fobjc\-exceptions +\&\-freplace\-objc\-classes +\&\-fzero\-link +\&\-gen\-decls +\&\-Wno\-protocol \-Wselector \-Wundeclared\-selector\fR +.IP "\fILanguage Independent Options\fR" 4 +.IX Item "Language Independent Options" +\&\fB\-fmessage\-length=\fR\fIn\fR +\&\fB\-fdiagnostics\-show\-location=\fR[\fBonce\fR|\fBevery-line\fR] +.IP "\fIWarning Options\fR" 4 +.IX Item "Warning Options" +\&\fB\-fsyntax\-only \-pedantic \-pedantic\-errors +\&\-w \-Wextra \-Wall \-Waggregate\-return +\&\-Wcast\-align \-Wcast\-qual \-Wchar\-subscripts \-Wcomment +\&\-Wconversion \-Wno\-deprecated\-declarations +\&\-Wdisabled\-optimization \-Wno\-div\-by\-zero \-Wendif\-labels +\&\-Werror \-Werror\-implicit\-function\-declaration +\&\-Wfloat\-equal \-Wformat \-Wformat=2 +\&\-Wno\-format\-extra\-args \-Wformat\-nonliteral +\&\-Wformat\-security \-Wformat\-y2k +\&\-Wimplicit \-Wimplicit\-function\-declaration \-Wimplicit\-int +\&\-Wimport \-Wno\-import \-Winit\-self \-Winline +\&\-Wno\-invalid\-offsetof \-Winvalid\-pch +\&\-Wlarger\-than\-\fR\fIlen\fR \fB\-Wlong\-long +\&\-Wmain \-Wmissing\-braces +\&\-Wmissing\-format\-attribute \-Wmissing\-noreturn +\&\-Wno\-multichar \-Wnonnull \-Wpacked \-Wpadded +\&\-Wparentheses \-Wpointer\-arith \-Wredundant\-decls +\&\-Wreturn\-type \-Wsequence\-point \-Wshadow +\&\-Wsign\-compare \-Wstrict\-aliasing +\&\-Wswitch \-Wswitch\-default \-Wswitch\-enum +\&\-Wsystem\-headers \-Wtrigraphs \-Wundef \-Wuninitialized +\&\-Wunknown\-pragmas \-Wunreachable\-code +\&\-Wunused \-Wunused\-function \-Wunused\-label \-Wunused\-parameter +\&\-Wunused\-value \-Wunused\-variable \-Wwrite\-strings\fR +.IP "\fIC\-only Warning Options\fR" 4 +.IX Item "C-only Warning Options" +\&\fB\-Wbad\-function\-cast \-Wmissing\-declarations +\&\-Wmissing\-prototypes \-Wnested\-externs \-Wold\-style\-definition +\&\-Wstrict\-prototypes \-Wtraditional +\&\-Wdeclaration\-after\-statement\fR +.IP "\fIDebugging Options\fR" 4 +.IX Item "Debugging Options" +\&\fB\-d\fR\fIletters\fR \fB\-dumpspecs \-dumpmachine \-dumpversion +\&\-fdump\-unnumbered \-fdump\-translation\-unit\fR[\fB\-\fR\fIn\fR] +\&\fB\-fdump\-class\-hierarchy\fR[\fB\-\fR\fIn\fR] +\&\fB\-fdump\-tree\-original\fR[\fB\-\fR\fIn\fR] +\&\fB\-fdump\-tree\-optimized\fR[\fB\-\fR\fIn\fR] +\&\fB\-fdump\-tree\-inlined\fR[\fB\-\fR\fIn\fR] +\&\fB\-feliminate\-dwarf2\-dups \-feliminate\-unused\-debug\-types +\&\-feliminate\-unused\-debug\-symbols \-fmem\-report \-fprofile\-arcs +\&\-frandom\-seed=\fR\fIstring\fR \fB\-fsched\-verbose=\fR\fIn\fR +\&\fB\-ftest\-coverage \-ftime\-report +\&\-g \-g\fR\fIlevel\fR \fB\-gcoff \-gdwarf\-2 +\&\-ggdb \-gstabs \-gstabs+ \-gvms \-gxcoff \-gxcoff+ +\&\-p \-pg \-print\-file\-name=\fR\fIlibrary\fR \fB\-print\-libgcc\-file\-name +\&\-print\-multi\-directory \-print\-multi\-lib +\&\-print\-prog\-name=\fR\fIprogram\fR \fB\-print\-search\-dirs \-Q +\&\-save\-temps \-time\fR +.IP "\fIOptimization Options\fR" 4 +.IX Item "Optimization Options" +\&\fB\-falign\-functions=\fR\fIn\fR \fB\-falign\-jumps=\fR\fIn\fR +\&\fB\-falign\-labels=\fR\fIn\fR \fB\-falign\-loops=\fR\fIn\fR +\&\fB\-fbranch\-probabilities \-fprofile\-values \-fvpt \-fbranch\-target\-load\-optimize +\&\-fbranch\-target\-load\-optimize2 \-fcaller\-saves \-fcprop\-registers +\&\-fcse\-follow\-jumps \-fcse\-skip\-blocks \-fdata\-sections +\&\-fdelayed\-branch \-fdelete\-null\-pointer\-checks +\&\-fexpensive\-optimizations \-ffast\-math \-ffloat\-store +\&\-fforce\-addr \-fforce\-mem \-ffunction\-sections +\&\-fgcse \-fgcse\-lm \-fgcse\-sm \-fgcse\-las \-floop\-optimize +\&\-fcrossjumping \-fif\-conversion \-fif\-conversion2 +\&\-finline\-functions \-finline\-limit=\fR\fIn\fR \fB\-fkeep\-inline\-functions +\&\-fkeep\-static\-consts \-fmerge\-constants \-fmerge\-all\-constants +\&\-fmove\-all\-movables \-fnew\-ra \-fno\-branch\-count\-reg +\&\-fno\-default\-inline \-fno\-defer\-pop +\&\-fno\-function\-cse \-fno\-guess\-branch\-probability +\&\-fno\-inline \-fno\-math\-errno \-fno\-peephole \-fno\-peephole2 +\&\-funsafe\-math\-optimizations \-ffinite\-math\-only +\&\-fno\-trapping\-math \-fno\-zero\-initialized\-in\-bss +\&\-fomit\-frame\-pointer \-foptimize\-register\-move +\&\-foptimize\-sibling\-calls \-fprefetch\-loop\-arrays +\&\-fprofile\-generate \-fprofile\-use +\&\-freduce\-all\-givs \-fregmove \-frename\-registers +\&\-freorder\-blocks \-freorder\-functions +\&\-frerun\-cse\-after\-loop \-frerun\-loop\-opt +\&\-frounding\-math \-fschedule\-insns \-fschedule\-insns2 +\&\-fno\-sched\-interblock \-fno\-sched\-spec \-fsched\-spec\-load +\&\-fsched\-spec\-load\-dangerous +\&\-fsched\-stalled\-insns=\fR\fIn\fR \fB\-sched\-stalled\-insns\-dep=\fR\fIn\fR +\&\fB\-fsched2\-use\-superblocks +\&\-fsched2\-use\-traces \-fsignaling\-nans +\&\-fsingle\-precision\-constant +\&\-fstrength\-reduce \-fstrict\-aliasing \-ftracer \-fthread\-jumps +\&\-funroll\-all\-loops \-funroll\-loops \-fpeel\-loops +\&\-funswitch\-loops \-fold\-unroll\-loops \-fold\-unroll\-all\-loops +\&\-\-param\fR \fIname\fR\fB=\fR\fIvalue\fR +\&\fB\-O \-O0 \-O1 \-O2 \-O3 \-Os\fR +.IP "\fIPreprocessor Options\fR" 4 +.IX Item "Preprocessor Options" +\&\fB\-A\fR\fIquestion\fR\fB=\fR\fIanswer\fR +\&\fB\-A\-\fR\fIquestion\fR[\fB=\fR\fIanswer\fR] +\&\fB\-C \-dD \-dI \-dM \-dN +\&\-D\fR\fImacro\fR[\fB=\fR\fIdefn\fR] \fB\-E \-H +\&\-idirafter\fR \fIdir\fR +\&\fB\-include\fR \fIfile\fR \fB\-imacros\fR \fIfile\fR +\&\fB\-iprefix\fR \fIfile\fR \fB\-iwithprefix\fR \fIdir\fR +\&\fB\-iwithprefixbefore\fR \fIdir\fR \fB\-isystem\fR \fIdir\fR +\&\fB\-M \-MM \-MF \-MG \-MP \-MQ \-MT \-nostdinc +\&\-P \-fworking\-directory \-remap +\&\-trigraphs \-undef \-U\fR\fImacro\fR \fB\-Wp,\fR\fIoption\fR +\&\fB\-Xpreprocessor\fR \fIoption\fR +.IP "\fIAssembler Option\fR" 4 +.IX Item "Assembler Option" +\&\fB\-Wa,\fR\fIoption\fR \fB\-Xassembler\fR \fIoption\fR +.IP "\fILinker Options\fR" 4 +.IX Item "Linker Options" +\&\fIobject-file-name\fR \fB\-l\fR\fIlibrary\fR +\&\fB\-nostartfiles \-nodefaultlibs \-nostdlib \-pie +\&\-s \-static \-static\-libgcc \-shared \-shared\-libgcc \-symbolic +\&\-Wl,\fR\fIoption\fR \fB\-Xlinker\fR \fIoption\fR +\&\fB\-u\fR \fIsymbol\fR +.IP "\fIDirectory Options\fR" 4 +.IX Item "Directory Options" +\&\fB\-B\fR\fIprefix\fR \fB\-I\fR\fIdir\fR \fB\-I\- \-L\fR\fIdir\fR \fB\-specs=\fR\fIfile\fR +.IP "\fITarget Options\fR" 4 +.IX Item "Target Options" +\&\fB\-V\fR \fIversion\fR \fB\-b\fR \fImachine\fR +.IP "\fIMachine Dependent Options\fR" 4 +.IX Item "Machine Dependent Options" +\&\fIM680x0 Options\fR +\&\fB\-m68000 \-m68020 \-m68020\-40 \-m68020\-60 \-m68030 \-m68040 +\&\-m68060 \-mcpu32 \-m5200 \-m68881 \-mbitfield \-mc68000 \-mc68020 +\&\-mnobitfield \-mrtd \-mshort \-msoft\-float \-mpcrel +\&\-malign\-int \-mstrict\-align \-msep\-data \-mno\-sep\-data +\&\-mshared\-library\-id=n \-mid\-shared\-library \-mno\-id\-shared\-library\fR +.Sp +\&\fIM68hc1x Options\fR +\&\fB\-m6811 \-m6812 \-m68hc11 \-m68hc12 \-m68hcs12 +\&\-mauto\-incdec \-minmax \-mlong\-calls \-mshort +\&\-msoft\-reg\-count=\fR\fIcount\fR +.Sp +\&\fI\s-1VAX\s0 Options\fR +\&\fB\-mg \-mgnu \-munix\fR +.Sp +\&\fI\s-1SPARC\s0 Options\fR +\&\fB\-mcpu=\fR\fIcpu-type\fR +\&\fB\-mtune=\fR\fIcpu-type\fR +\&\fB\-mcmodel=\fR\fIcode-model\fR +\&\fB\-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 \-mv8 +\&\-threads \-pthreads\fR +.Sp +\&\fI\s-1ARM\s0 Options\fR +\&\fB\-mapcs\-frame \-mno\-apcs\-frame +\&\-mapcs\-26 \-mapcs\-32 +\&\-mapcs\-stack\-check \-mno\-apcs\-stack\-check +\&\-mapcs\-float \-mno\-apcs\-float +\&\-mapcs\-reentrant \-mno\-apcs\-reentrant +\&\-msched\-prolog \-mno\-sched\-prolog +\&\-mlittle\-endian \-mbig\-endian \-mwords\-little\-endian +\&\-malignment\-traps \-mno\-alignment\-traps +\&\-msoft\-float \-mhard\-float \-mfpe +\&\-mthumb\-interwork \-mno\-thumb\-interwork +\&\-mcpu=\fR\fIname\fR \fB\-march=\fR\fIname\fR \fB\-mfpe=\fR\fIname\fR +\&\fB\-mstructure\-size\-boundary=\fR\fIn\fR +\&\fB\-mabort\-on\-noreturn +\&\-mlong\-calls \-mno\-long\-calls +\&\-msingle\-pic\-base \-mno\-single\-pic\-base +\&\-mpic\-register=\fR\fIreg\fR +\&\fB\-mnop\-fun\-dllimport +\&\-mcirrus\-fix\-invalid\-insns \-mno\-cirrus\-fix\-invalid\-insns +\&\-mpoke\-function\-name +\&\-mthumb \-marm +\&\-mtpcs\-frame \-mtpcs\-leaf\-frame +\&\-mcaller\-super\-interworking \-mcallee\-super\-interworking\fR +.Sp +\&\fI\s-1MN10300\s0 Options\fR +\&\fB\-mmult\-bug \-mno\-mult\-bug +\&\-mam33 \-mno\-am33 +\&\-mam33\-2 \-mno\-am33\-2 +\&\-mno\-crt0 \-mrelax\fR +.Sp +\&\fIM32R/D Options\fR +\&\fB\-m32r2 \-m32rx \-m32r +\&\-mdebug +\&\-malign\-loops \-mno\-align\-loops +\&\-missue\-rate=\fR\fInumber\fR +\&\fB\-mbranch\-cost=\fR\fInumber\fR +\&\fB\-mmodel=\fR\fIcode-size-model-type\fR +\&\fB\-msdata=\fR\fIsdata-type\fR +\&\fB\-mno\-flush\-func \-mflush\-func=\fR\fIname\fR +\&\fB\-mno\-flush\-trap \-mflush\-trap=\fR\fInumber\fR +\&\fB\-G\fR \fInum\fR +.Sp +\&\fI\s-1RS/6000\s0 and PowerPC Options\fR +\&\fB\-mcpu=\fR\fIcpu-type\fR +\&\fB\-mtune=\fR\fIcpu-type\fR +\&\fB\-mpower \-mno\-power \-mpower2 \-mno\-power2 +\&\-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\-compat \-mno\-xl\-compat \-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 \-mrelocatable\-lib \-mno\-relocatable\-lib +\&\-mtoc \-mno\-toc \-mlittle \-mlittle\-endian \-mbig \-mbig\-endian +\&\-mdynamic\-no\-pic +\&\-mprioritize\-restricted\-insns=\fR\fIpriority\fR +\&\fB\-msched\-costly\-dep=\fR\fIdependence_type\fR +\&\fB\-minsert\-sched\-nops=\fR\fIscheme\fR +\&\fB\-mcall\-sysv \-mcall\-netbsd +\&\-maix\-struct\-return \-msvr4\-struct\-return +\&\-mabi=altivec \-mabi=no\-altivec +\&\-mabi=spe \-mabi=no\-spe +\&\-misel=yes \-misel=no +\&\-mspe=yes \-mspe=no +\&\-mfloat\-gprs=yes \-mfloat\-gprs=no +\&\-mprototype \-mno\-prototype +\&\-msim \-mmvme \-mads \-myellowknife \-memb \-msdata +\&\-msdata=\fR\fIopt\fR \fB\-mvxworks \-mwindiss \-G\fR \fInum\fR \fB\-pthread\fR +.Sp +\&\fIDarwin Options\fR +\&\fB\-all_load \-allowable_client \-arch \-arch_errors_fatal +\&\-arch_only \-bind_at_load \-bundle \-bundle_loader +\&\-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 +\&\-seg_addr_table \-seg_addr_table_filename \-seglinkedit +\&\-segprot \-segs_read_only_addr \-segs_read_write_addr +\&\-single_module \-static \-sub_library \-sub_umbrella +\&\-twolevel_namespace \-umbrella \-undefined +\&\-unexported_symbols_list \-weak_reference_mismatches +\&\-whatsloaded\fR +.Sp +\&\fI\s-1MIPS\s0 Options\fR +\&\fB\-EL \-EB \-march=\fR\fIarch\fR \fB\-mtune=\fR\fIarch\fR +\&\fB\-mips1 \-mips2 \-mips3 \-mips4 \-mips32 \-mips32r2 \-mips64 +\&\-mips16 \-mno\-mips16 \-mabi=\fR\fIabi\fR \fB\-mabicalls \-mno\-abicalls +\&\-mxgot \-mno\-xgot \-membedded\-pic \-mno\-embedded\-pic +\&\-mgp32 \-mgp64 \-mfp32 \-mfp64 \-mhard\-float \-msoft\-float +\&\-msingle\-float \-mdouble\-float \-mint64 \-mlong64 \-mlong32 +\&\-G\fR\fInum\fR \fB\-membedded\-data \-mno\-embedded\-data +\&\-muninit\-const\-in\-rodata \-mno\-uninit\-const\-in\-rodata +\&\-msplit\-addresses \-mno\-split\-addresses +\&\-mexplicit\-relocs \-mno\-explicit\-relocs +\&\-mrnames \-mno\-rnames +\&\-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=\fR\fIfunc\fR +\&\fB\-mno\-flush\-func \-mbranch\-likely \-mno\-branch\-likely\fR +.Sp +\&\fIi386 and x86\-64 Options\fR +\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR +\&\fB\-mfpmath=\fR\fIunit\fR +\&\fB\-masm=\fR\fIdialect\fR \fB\-mno\-fancy\-math\-387 +\&\-mno\-fp\-ret\-in\-387 \-msoft\-float \-msvr3\-shlib +\&\-mno\-wide\-multiply \-mrtd \-malign\-double +\&\-mpreferred\-stack\-boundary=\fR\fInum\fR +\&\fB\-mmmx \-msse \-msse2 \-msse3 \-m3dnow +\&\-mthreads \-mno\-align\-stringops \-minline\-all\-stringops +\&\-mpush\-args \-maccumulate\-outgoing\-args \-m128bit\-long\-double +\&\-m96bit\-long\-double \-mregparm=\fR\fInum\fR \fB\-momit\-leaf\-frame\-pointer +\&\-mno\-red\-zone \-mno\-tls\-direct\-seg\-refs +\&\-mcmodel=\fR\fIcode-model\fR +\&\fB\-m32 \-m64\fR +.Sp +\&\fI\s-1HPPA\s0 Options\fR +\&\fB\-march=\fR\fIarchitecture-type\fR +\&\fB\-mbig\-switch \-mdisable\-fpregs \-mdisable\-indexing +\&\-mfast\-indirect\-calls \-mgas \-mgnu\-ld \-mhp\-ld +\&\-mjump\-in\-delay \-mlinker\-opt \-mlong\-calls +\&\-mlong\-load\-store \-mno\-big\-switch \-mno\-disable\-fpregs +\&\-mno\-disable\-indexing \-mno\-fast\-indirect\-calls \-mno\-gas +\&\-mno\-jump\-in\-delay \-mno\-long\-load\-store +\&\-mno\-portable\-runtime \-mno\-soft\-float +\&\-mno\-space\-regs \-msoft\-float \-mpa\-risc\-1\-0 +\&\-mpa\-risc\-1\-1 \-mpa\-risc\-2\-0 \-mportable\-runtime +\&\-mschedule=\fR\fIcpu-type\fR \fB\-mspace\-regs \-msio \-mwsio +\&\-nolibdld \-static \-threads\fR +.Sp +\&\fIIntel 960 Options\fR +\&\fB\-m\fR\fIcpu-type\fR \fB\-masm\-compat \-mclean\-linkage +\&\-mcode\-align \-mcomplex\-addr \-mleaf\-procedures +\&\-mic\-compat \-mic2.0\-compat \-mic3.0\-compat +\&\-mintel\-asm \-mno\-clean\-linkage \-mno\-code\-align +\&\-mno\-complex\-addr \-mno\-leaf\-procedures +\&\-mno\-old\-align \-mno\-strict\-align \-mno\-tail\-call +\&\-mnumerics \-mold\-align \-msoft\-float \-mstrict\-align +\&\-mtail\-call\fR +.Sp +\&\fI\s-1DEC\s0 Alpha Options\fR +\&\fB\-mno\-fp\-regs \-msoft\-float \-malpha\-as \-mgas +\&\-mieee \-mieee\-with\-inexact \-mieee\-conformant +\&\-mfp\-trap\-mode=\fR\fImode\fR \fB\-mfp\-rounding\-mode=\fR\fImode\fR +\&\fB\-mtrap\-precision=\fR\fImode\fR \fB\-mbuild\-constants +\&\-mcpu=\fR\fIcpu-type\fR \fB\-mtune=\fR\fIcpu-type\fR +\&\fB\-mbwx \-mmax \-mfix \-mcix +\&\-mfloat\-vax \-mfloat\-ieee +\&\-mexplicit\-relocs \-msmall\-data \-mlarge\-data +\&\-msmall\-text \-mlarge\-text +\&\-mmemory\-latency=\fR\fItime\fR +.Sp +\&\fI\s-1DEC\s0 Alpha/VMS Options\fR +\&\fB\-mvms\-return\-codes\fR +.Sp +\&\fIH8/300 Options\fR +\&\fB\-mrelax \-mh \-ms \-mn \-mint32 \-malign\-300\fR +.Sp +\&\fI\s-1SH\s0 Options\fR +\&\fB\-m1 \-m2 \-m2e \-m3 \-m3e +\&\-m4\-nofpu \-m4\-single\-only \-m4\-single \-m4 +\&\-m5\-64media \-m5\-64media\-nofpu +\&\-m5\-32media \-m5\-32media\-nofpu +\&\-m5\-compact \-m5\-compact\-nofpu +\&\-mb \-ml \-mdalign \-mrelax +\&\-mbigtable \-mfmovd \-mhitachi \-mnomacsave +\&\-mieee \-misize \-mpadstruct \-mspace +\&\-mprefergot \-musermode\fR +.Sp +\&\fISystem V Options\fR +\&\fB\-Qy \-Qn \-YP,\fR\fIpaths\fR \fB\-Ym,\fR\fIdir\fR +.Sp +\&\fI\s-1ARC\s0 Options\fR +\&\fB\-EB \-EL +\&\-mmangle\-cpu \-mcpu=\fR\fIcpu\fR \fB\-mtext=\fR\fItext-section\fR +\&\fB\-mdata=\fR\fIdata-section\fR \fB\-mrodata=\fR\fIreadonly-data-section\fR +.Sp +\&\fITMS320C3x/C4x Options\fR +\&\fB\-mcpu=\fR\fIcpu\fR \fB\-mbig \-msmall \-mregparm \-mmemparm +\&\-mfast\-fix \-mmpyi \-mbk \-mti \-mdp\-isr\-reload +\&\-mrpts=\fR\fIcount\fR \fB\-mrptb \-mdb \-mloop\-unsigned +\&\-mparallel\-insns \-mparallel\-mpy \-mpreserve\-float\fR +.Sp +\&\fIV850 Options\fR +\&\fB\-mlong\-calls \-mno\-long\-calls \-mep \-mno\-ep +\&\-mprolog\-function \-mno\-prolog\-function \-mspace +\&\-mtda=\fR\fIn\fR \fB\-msda=\fR\fIn\fR \fB\-mzda=\fR\fIn\fR +\&\fB\-mapp\-regs \-mno\-app\-regs +\&\-mdisable\-callt \-mno\-disable\-callt +\&\-mv850e1 +\&\-mv850e +\&\-mv850 \-mbig\-switch\fR +.Sp +\&\fI\s-1NS32K\s0 Options\fR +\&\fB\-m32032 \-m32332 \-m32532 \-m32081 \-m32381 +\&\-mmult\-add \-mnomult\-add \-msoft\-float \-mrtd \-mnortd +\&\-mregparam \-mnoregparam \-msb \-mnosb +\&\-mbitfield \-mnobitfield \-mhimem \-mnohimem\fR +.Sp +\&\fI\s-1AVR\s0 Options\fR +\&\fB\-mmcu=\fR\fImcu\fR \fB\-msize \-minit\-stack=\fR\fIn\fR \fB\-mno\-interrupts +\&\-mcall\-prologues \-mno\-tablejump \-mtiny\-stack\fR +.Sp +\&\fIMCore Options\fR +\&\fB\-mhardlit \-mno\-hardlit \-mdiv \-mno\-div \-mrelax\-immediates +\&\-mno\-relax\-immediates \-mwide\-bitfields \-mno\-wide\-bitfields +\&\-m4byte\-functions \-mno\-4byte\-functions \-mcallgraph\-data +\&\-mno\-callgraph\-data \-mslow\-bytes \-mno\-slow\-bytes \-mno\-lsim +\&\-mlittle\-endian \-mbig\-endian \-m210 \-m340 \-mstack\-increment\fR +.Sp +\&\fI\s-1MMIX\s0 Options\fR +\&\fB\-mlibfuncs \-mno\-libfuncs \-mepsilon \-mno\-epsilon \-mabi=gnu +\&\-mabi=mmixware \-mzero\-extend \-mknuthdiv \-mtoplevel\-symbols +\&\-melf \-mbranch\-predict \-mno\-branch\-predict \-mbase\-addresses +\&\-mno\-base\-addresses \-msingle\-exit \-mno\-single\-exit\fR +.Sp +\&\fI\s-1IA\-64\s0 Options\fR +\&\fB\-mbig\-endian \-mlittle\-endian \-mgnu\-as \-mgnu\-ld \-mno\-pic +\&\-mvolatile\-asm\-stop \-mb\-step \-mregister\-names \-mno\-sdata +\&\-mconstant\-gp \-mauto\-pic \-minline\-float\-divide\-min\-latency +\&\-minline\-float\-divide\-max\-throughput +\&\-minline\-int\-divide\-min\-latency +\&\-minline\-int\-divide\-max\-throughput +\&\-minline\-sqrt\-min\-latency \-minline\-sqrt\-max\-throughput +\&\-mno\-dwarf2\-asm \-mearly\-stop\-bits +\&\-mfixed\-range=\fR\fIregister-range\fR \fB\-mtls\-size=\fR\fItls-size\fR +\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-mt \-pthread \-milp32 \-mlp64\fR +.Sp +\&\fID30V Options\fR +\&\fB\-mextmem \-mextmemory \-monchip \-mno\-asm\-optimize +\&\-masm\-optimize \-mbranch\-cost=\fR\fIn\fR \fB\-mcond\-exec=\fR\fIn\fR +.Sp +\&\fIS/390 and zSeries Options\fR +\&\fB\-mtune=\fR\fIcpu-type\fR \fB\-march=\fR\fIcpu-type\fR +\&\fB\-mhard\-float \-msoft\-float \-mbackchain \-mno\-backchain +\&\-msmall\-exec \-mno\-small\-exec \-mmvcle \-mno\-mvcle +\&\-m64 \-m31 \-mdebug \-mno\-debug \-mesa \-mzarch \-mfused\-madd \-mno\-fused\-madd\fR +.Sp +\&\fI\s-1CRIS\s0 Options\fR +\&\fB\-mcpu=\fR\fIcpu\fR \fB\-march=\fR\fIcpu\fR \fB\-mtune=\fR\fIcpu\fR +\&\fB\-mmax\-stack\-frame=\fR\fIn\fR \fB\-melinux\-stacksize=\fR\fIn\fR +\&\fB\-metrax4 \-metrax100 \-mpdebug \-mcc\-init \-mno\-side\-effects +\&\-mstack\-align \-mdata\-align \-mconst\-align +\&\-m32\-bit \-m16\-bit \-m8\-bit \-mno\-prologue\-epilogue \-mno\-gotplt +\&\-melf \-maout \-melinux \-mlinux \-sim \-sim2 +\&\-mmul\-bug\-workaround \-mno\-mul\-bug\-workaround\fR +.Sp +\&\fI\s-1PDP\-11\s0 Options\fR +\&\fB\-mfpu \-msoft\-float \-mac0 \-mno\-ac0 \-m40 \-m45 \-m10 +\&\-mbcopy \-mbcopy\-builtin \-mint32 \-mno\-int16 +\&\-mint16 \-mno\-int32 \-mfloat32 \-mno\-float64 +\&\-mfloat64 \-mno\-float32 \-mabshi \-mno\-abshi +\&\-mbranch\-expensive \-mbranch\-cheap +\&\-msplit \-mno\-split \-munix\-asm \-mdec\-asm\fR +.Sp +\&\fIXstormy16 Options\fR +\&\fB\-msim\fR +.Sp +\&\fIXtensa Options\fR +\&\fB\-mconst16 \-mno\-const16 +\&\-mfused\-madd \-mno\-fused\-madd +\&\-mtext\-section\-literals \-mno\-text\-section\-literals +\&\-mtarget\-align \-mno\-target\-align +\&\-mlongcalls \-mno\-longcalls\fR +.Sp +\&\fI\s-1FRV\s0 Options\fR +\&\fB\-mgpr\-32 \-mgpr\-64 \-mfpr\-32 \-mfpr\-64 +\&\-mhard\-float \-msoft\-float +\&\-malloc\-cc \-mfixed\-cc \-mdword \-mno\-dword +\&\-mdouble \-mno\-double +\&\-mmedia \-mno\-media \-mmuladd \-mno\-muladd +\&\-mlibrary\-pic \-macc\-4 \-macc\-8 +\&\-mpack \-mno\-pack \-mno\-eflags \-mcond\-move \-mno\-cond\-move +\&\-mscc \-mno\-scc \-mcond\-exec \-mno\-cond\-exec +\&\-mvliw\-branch \-mno\-vliw\-branch +\&\-mmulti\-cond\-exec \-mno\-multi\-cond\-exec \-mnested\-cond\-exec +\&\-mno\-nested\-cond\-exec \-mtomcat\-stats +\&\-mcpu=\fR\fIcpu\fR +.IP "\fICode Generation Options\fR" 4 +.IX Item "Code Generation Options" +\&\fB\-fcall\-saved\-\fR\fIreg\fR \fB\-fcall\-used\-\fR\fIreg\fR +\&\fB\-ffixed\-\fR\fIreg\fR \fB\-fexceptions +\&\-fnon\-call\-exceptions \-funwind\-tables +\&\-fasynchronous\-unwind\-tables +\&\-finhibit\-size\-directive \-finstrument\-functions +\&\-fno\-common \-fno\-ident +\&\-fpcc\-struct\-return \-fpic \-fPIC \-fpie \-fPIE +\&\-freg\-struct\-return \-fshared\-data \-fshort\-enums +\&\-fshort\-double \-fshort\-wchar +\&\-fverbose\-asm \-fpack\-struct \-fstack\-check +\&\-fstack\-limit\-register=\fR\fIreg\fR \fB\-fstack\-limit\-symbol=\fR\fIsym\fR +\&\fB\-fargument\-alias \-fargument\-noalias +\&\-fargument\-noalias\-global \-fleading\-underscore +\&\-ftls\-model=\fR\fImodel\fR +\&\fB\-ftrapv \-fwrapv \-fbounds\-check\fR +.Sh "Options Controlling the Kind of Output" +.IX Subsection "Options Controlling the Kind of Output" +Compilation can involve up to four stages: preprocessing, compilation +proper, assembly and linking, always in that order. \s-1GCC\s0 is capable of +preprocessing and compiling several files either into several +assembler input files, or into one assembler input file; then each +assembler input file produces an object file, and linking combines all +the object files (those newly compiled, and those specified as input) +into an executable file. +.PP +For any given input file, the file name suffix determines what kind of +compilation is done: +.IP "\fIfile\fR\fB.c\fR" 4 +.IX Item "file.c" +C source code which must be preprocessed. +.IP "\fIfile\fR\fB.i\fR" 4 +.IX Item "file.i" +C source code which should not be preprocessed. +.IP "\fIfile\fR\fB.ii\fR" 4 +.IX Item "file.ii" +\&\*(C+ source code which should not be preprocessed. +.IP "\fIfile\fR\fB.m\fR" 4 +.IX Item "file.m" +Objective-C source code. Note that you must link with the library +\&\fIlibobjc.a\fR to make an Objective-C program work. +.IP "\fIfile\fR\fB.mi\fR" 4 +.IX Item "file.mi" +Objective-C source code which should not be preprocessed. +.IP "\fIfile\fR\fB.h\fR" 4 +.IX Item "file.h" +C or \*(C+ header file to be turned into a precompiled header. +.IP "\fIfile\fR\fB.cc\fR" 4 +.IX Item "file.cc" +.PD 0 +.IP "\fIfile\fR\fB.cp\fR" 4 +.IX Item "file.cp" +.IP "\fIfile\fR\fB.cxx\fR" 4 +.IX Item "file.cxx" +.IP "\fIfile\fR\fB.cpp\fR" 4 +.IX Item "file.cpp" +.IP "\fIfile\fR\fB.CPP\fR" 4 +.IX Item "file.CPP" +.IP "\fIfile\fR\fB.c++\fR" 4 +.IX Item "file.c++" +.IP "\fIfile\fR\fB.C\fR" 4 +.IX Item "file.C" +.PD +\&\*(C+ source code which must be preprocessed. Note that in \fB.cxx\fR, +the last two letters must both be literally \fBx\fR. Likewise, +\&\fB.C\fR refers to a literal capital C. +.IP "\fIfile\fR\fB.hh\fR" 4 +.IX Item "file.hh" +.PD 0 +.IP "\fIfile\fR\fB.H\fR" 4 +.IX Item "file.H" +.PD +\&\*(C+ header file to be turned into a precompiled header. +.IP "\fIfile\fR\fB.f\fR" 4 +.IX Item "file.f" +.PD 0 +.IP "\fIfile\fR\fB.for\fR" 4 +.IX Item "file.for" +.IP "\fIfile\fR\fB.FOR\fR" 4 +.IX Item "file.FOR" +.PD +Fortran source code which should not be preprocessed. +.IP "\fIfile\fR\fB.F\fR" 4 +.IX Item "file.F" +.PD 0 +.IP "\fIfile\fR\fB.fpp\fR" 4 +.IX Item "file.fpp" +.IP "\fIfile\fR\fB.FPP\fR" 4 +.IX Item "file.FPP" +.PD +Fortran source code which must be preprocessed (with the traditional +preprocessor). +.IP "\fIfile\fR\fB.r\fR" 4 +.IX Item "file.r" +Fortran source code which must be preprocessed with a \s-1RATFOR\s0 +preprocessor (not included with \s-1GCC\s0). +.IP "\fIfile\fR\fB.ads\fR" 4 +.IX Item "file.ads" +Ada source code file which contains a library unit declaration (a +declaration of a package, subprogram, or generic, or a generic +instantiation), or a library unit renaming declaration (a package, +generic, or subprogram renaming declaration). Such files are also +called \fIspecs\fR. +.IP "\fIfile\fR\fB.adb\fR" 4 +.IX Item "file.adb" +Ada source code file containing a library unit body (a subprogram or +package body). Such files are also called \fIbodies\fR. +.IP "\fIfile\fR\fB.s\fR" 4 +.IX Item "file.s" +Assembler code. +.IP "\fIfile\fR\fB.S\fR" 4 +.IX Item "file.S" +Assembler code which must be preprocessed. +.IP "\fIother\fR" 4 +.IX Item "other" +An object file to be fed straight into linking. +Any file name with no recognized suffix is treated this way. +.PP +You can specify the input language explicitly with the \fB\-x\fR option: +.IP "\fB\-x\fR \fIlanguage\fR" 4 +.IX Item "-x language" +Specify explicitly the \fIlanguage\fR for the following input files +(rather than letting the compiler choose a default based on the file +name suffix). This option applies to all following input files until +the next \fB\-x\fR option. Possible values for \fIlanguage\fR are: +.Sp +.Vb 8 +\& c c-header cpp-output +\& c++ c++-header c++-cpp-output +\& objective-c objective-c-header objc-cpp-output +\& assembler assembler-with-cpp +\& ada +\& f77 f77-cpp-input ratfor +\& java +\& treelang +.Ve +.IP "\fB\-x none\fR" 4 +.IX Item "-x none" +Turn off any specification of a language, so that subsequent files are +handled according to their file name suffixes (as they are if \fB\-x\fR +has not been used at all). +.IP "\fB\-pass\-exit\-codes\fR" 4 +.IX Item "-pass-exit-codes" +Normally the \fBgcc\fR program will exit with the code of 1 if any +phase of the compiler returns a non-success return code. If you specify +\&\fB\-pass\-exit\-codes\fR, the \fBgcc\fR program will instead return with +numerically highest error produced by any phase that returned an error +indication. +.PP +If you only want some of the stages of compilation, you can use +\&\fB\-x\fR (or filename suffixes) to tell \fBgcc\fR where to start, and +one of the options \fB\-c\fR, \fB\-S\fR, or \fB\-E\fR to say where +\&\fBgcc\fR is to stop. Note that some combinations (for example, +\&\fB\-x cpp-output \-E\fR) instruct \fBgcc\fR to do nothing at all. +.IP "\fB\-c\fR" 4 +.IX Item "-c" +Compile or assemble the source files, but do not link. The linking +stage simply is not done. The ultimate output is in the form of an +object file for each source file. +.Sp +By default, the object file name for a source file is made by replacing +the suffix \fB.c\fR, \fB.i\fR, \fB.s\fR, etc., with \fB.o\fR. +.Sp +Unrecognized input files, not requiring compilation or assembly, are +ignored. +.IP "\fB\-S\fR" 4 +.IX Item "-S" +Stop after the stage of compilation proper; do not assemble. The output +is in the form of an assembler code file for each non-assembler input +file specified. +.Sp +By default, the assembler file name for a source file is made by +replacing the suffix \fB.c\fR, \fB.i\fR, etc., with \fB.s\fR. +.Sp +Input files that don't require compilation are ignored. +.IP "\fB\-E\fR" 4 +.IX Item "-E" +Stop after the preprocessing stage; do not run the compiler proper. The +output is in the form of preprocessed source code, which is sent to the +standard output. +.Sp +Input files which don't require preprocessing are ignored. +.IP "\fB\-o\fR \fIfile\fR" 4 +.IX Item "-o file" +Place output in file \fIfile\fR. This applies regardless to whatever +sort of output is being produced, whether it be an executable file, +an object file, an assembler file or preprocessed C code. +.Sp +If you specify \fB\-o\fR when compiling more than one input file, or +you are producing an executable file as output, all the source files +on the command line will be compiled at once. +.Sp +If \fB\-o\fR is not specified, the default is to put an executable file +in \fIa.out\fR, the object file for \fI\fIsource\fI.\fIsuffix\fI\fR in +\&\fI\fIsource\fI.o\fR, its assembler file in \fI\fIsource\fI.s\fR, and +all preprocessed C source on standard output. +.IP "\fB\-v\fR" 4 +.IX Item "-v" +Print (on standard error output) the commands executed to run the stages +of compilation. Also print the version number of the compiler driver +program and of the preprocessor and the compiler proper. +.IP "\fB\-###\fR" 4 +.IX Item "-###" +Like \fB\-v\fR except the commands are not executed and all command +arguments are quoted. This is useful for shell scripts to capture the +driver-generated command lines. +.IP "\fB\-pipe\fR" 4 +.IX Item "-pipe" +Use pipes rather than temporary files for communication between the +various stages of compilation. This fails to work on some systems where +the assembler is unable to read from a pipe; but the \s-1GNU\s0 assembler has +no trouble. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +Print (on the standard output) a description of the command line options +understood by \fBgcc\fR. If the \fB\-v\fR option is also specified +then \fB\-\-help\fR will also be passed on to the various processes +invoked by \fBgcc\fR, so that they can display the command line options +they accept. If the \fB\-Wextra\fR option is also specified then command +line options which have no documentation associated with them will also +be displayed. +.IP "\fB\-\-target\-help\fR" 4 +.IX Item "--target-help" +Print (on the standard output) a description of target specific command +line options for each tool. +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +Display the version number and copyrights of the invoked \s-1GCC\s0. +.Sh "Compiling \*(C+ Programs" +.IX Subsection "Compiling Programs" +\&\*(C+ source files conventionally use one of the suffixes \fB.C\fR, +\&\fB.cc\fR, \fB.cpp\fR, \fB.CPP\fR, \fB.c++\fR, \fB.cp\fR, or +\&\fB.cxx\fR; \*(C+ header files often use \fB.hh\fR or \fB.H\fR; and +preprocessed \*(C+ files use the suffix \fB.ii\fR. \s-1GCC\s0 recognizes +files with these names and compiles them as \*(C+ programs even if you +call the compiler the same way as for compiling C programs (usually +with the name \fBgcc\fR). +.PP +However, \*(C+ programs often require class libraries as well as a +compiler that understands the \*(C+ language\-\-\-and under some +circumstances, you might want to compile programs or header files from +standard input, or otherwise without a suffix that flags them as \*(C+ +programs. You might also like to precompile a C header file with a +\&\fB.h\fR extension to be used in \*(C+ compilations. \fBg++\fR is a +program that calls \s-1GCC\s0 with the default language set to \*(C+, and +automatically specifies linking against the \*(C+ library. On many +systems, \fBg++\fR is also installed with the name \fBc++\fR. +.PP +When you compile \*(C+ programs, you may specify many of the same +command-line options that you use for compiling programs in any +language; or command-line options meaningful for C and related +languages; or options that are meaningful only for \*(C+ programs. +.Sh "Options Controlling C Dialect" +.IX Subsection "Options Controlling C Dialect" +The following options control the dialect of C (or languages derived +from C, such as \*(C+ and Objective\-C) that the compiler accepts: +.IP "\fB\-ansi\fR" 4 +.IX Item "-ansi" +In C mode, support all \s-1ISO\s0 C90 programs. In \*(C+ mode, +remove \s-1GNU\s0 extensions that conflict with \s-1ISO\s0 \*(C+. +.Sp +This turns off certain features of \s-1GCC\s0 that are incompatible with \s-1ISO\s0 +C90 (when compiling C code), or of standard \*(C+ (when compiling \*(C+ code), +such as the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, and +predefined macros such as \f(CW\*(C`unix\*(C'\fR and \f(CW\*(C`vax\*(C'\fR that identify the +type of system you are using. It also enables the undesirable and +rarely used \s-1ISO\s0 trigraph feature. For the C compiler, +it disables recognition of \*(C+ style \fB//\fR comments as well as +the \f(CW\*(C`inline\*(C'\fR keyword. +.Sp +The alternate keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_extension_\|_\*(C'\fR, +\&\f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR continue to work despite +\&\fB\-ansi\fR. You would not want to use them in an \s-1ISO\s0 C program, of +course, but it is useful to put them in header files that might be included +in compilations done with \fB\-ansi\fR. Alternate predefined macros +such as \f(CW\*(C`_\|_unix_\|_\*(C'\fR and \f(CW\*(C`_\|_vax_\|_\*(C'\fR are also available, with or +without \fB\-ansi\fR. +.Sp +The \fB\-ansi\fR option does not cause non-ISO programs to be +rejected gratuitously. For that, \fB\-pedantic\fR is required in +addition to \fB\-ansi\fR. +.Sp +The macro \f(CW\*(C`_\|_STRICT_ANSI_\|_\*(C'\fR is predefined when the \fB\-ansi\fR +option is used. Some header files may notice this macro and refrain +from declaring certain functions or defining certain macros that the +\&\s-1ISO\s0 standard doesn't call for; this is to avoid interfering with any +programs that might use these names for other things. +.Sp +Functions which would normally be built in but do not have semantics +defined by \s-1ISO\s0 C (such as \f(CW\*(C`alloca\*(C'\fR and \f(CW\*(C`ffs\*(C'\fR) are not built-in +functions with \fB\-ansi\fR is used. +.IP "\fB\-std=\fR" 4 +.IX Item "-std=" +Determine the language standard. This option is currently only +supported when compiling C or \*(C+. A value for this option must be +provided; possible values are +.RS 4 +.IP "\fBc89\fR" 4 +.IX Item "c89" +.PD 0 +.IP "\fBiso9899:1990\fR" 4 +.IX Item "iso9899:1990" +.PD +\&\s-1ISO\s0 C90 (same as \fB\-ansi\fR). +.IP "\fBiso9899:199409\fR" 4 +.IX Item "iso9899:199409" +\&\s-1ISO\s0 C90 as modified in amendment 1. +.IP "\fBc99\fR" 4 +.IX Item "c99" +.PD 0 +.IP "\fBc9x\fR" 4 +.IX Item "c9x" +.IP "\fBiso9899:1999\fR" 4 +.IX Item "iso9899:1999" +.IP "\fBiso9899:199x\fR" 4 +.IX Item "iso9899:199x" +.PD +\&\s-1ISO\s0 C99. Note that this standard is not yet fully supported; see +<\fBhttp://gcc.gnu.org/gcc\-3.4/c99status.html\fR> for more information. The +names \fBc9x\fR and \fBiso9899:199x\fR are deprecated. +.IP "\fBgnu89\fR" 4 +.IX Item "gnu89" +Default, \s-1ISO\s0 C90 plus \s-1GNU\s0 extensions (including some C99 features). +.IP "\fBgnu99\fR" 4 +.IX Item "gnu99" +.PD 0 +.IP "\fBgnu9x\fR" 4 +.IX Item "gnu9x" +.PD +\&\s-1ISO\s0 C99 plus \s-1GNU\s0 extensions. When \s-1ISO\s0 C99 is fully implemented in \s-1GCC\s0, +this will become the default. The name \fBgnu9x\fR is deprecated. +.IP "\fBc++98\fR" 4 +.IX Item "c++98" +The 1998 \s-1ISO\s0 \*(C+ standard plus amendments. +.IP "\fBgnu++98\fR" 4 +.IX Item "gnu++98" +The same as \fB\-std=c++98\fR plus \s-1GNU\s0 extensions. This is the +default for \*(C+ code. +.RE +.RS 4 +.Sp +Even when this option is not specified, you can still use some of the +features of newer standards in so far as they do not conflict with +previous C standards. For example, you may use \f(CW\*(C`_\|_restrict_\|_\*(C'\fR even +when \fB\-std=c99\fR is not specified. +.Sp +The \fB\-std\fR options specifying some version of \s-1ISO\s0 C have the same +effects as \fB\-ansi\fR, except that features that were not in \s-1ISO\s0 C90 +but are in the specified version (for example, \fB//\fR comments and +the \f(CW\*(C`inline\*(C'\fR keyword in \s-1ISO\s0 C99) are not disabled. +.RE +.IP "\fB\-aux\-info\fR \fIfilename\fR" 4 +.IX Item "-aux-info filename" +Output to the given filename prototyped declarations for all functions +declared and/or defined in a translation unit, including those in header +files. This option is silently ignored in any language other than C. +.Sp +Besides declarations, the file indicates, in comments, the origin of +each declaration (source file and line), whether the declaration was +implicit, prototyped or unprototyped (\fBI\fR, \fBN\fR for new or +\&\fBO\fR for old, respectively, in the first character after the line +number and the colon), and whether it came from a declaration or a +definition (\fBC\fR or \fBF\fR, respectively, in the following +character). In the case of function definitions, a K&R\-style list of +arguments followed by their declarations is also provided, inside +comments, after the declaration. +.IP "\fB\-fno\-asm\fR" 4 +.IX Item "-fno-asm" +Do not recognize \f(CW\*(C`asm\*(C'\fR, \f(CW\*(C`inline\*(C'\fR or \f(CW\*(C`typeof\*(C'\fR as a +keyword, so that code can use these words as identifiers. You can use +the keywords \f(CW\*(C`_\|_asm_\|_\*(C'\fR, \f(CW\*(C`_\|_inline_\|_\*(C'\fR and \f(CW\*(C`_\|_typeof_\|_\*(C'\fR +instead. \fB\-ansi\fR implies \fB\-fno\-asm\fR. +.Sp +In \*(C+, this switch only affects the \f(CW\*(C`typeof\*(C'\fR keyword, since +\&\f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`inline\*(C'\fR are standard keywords. You may want to +use the \fB\-fno\-gnu\-keywords\fR flag instead, which has the same +effect. In C99 mode (\fB\-std=c99\fR or \fB\-std=gnu99\fR), this +switch only affects the \f(CW\*(C`asm\*(C'\fR and \f(CW\*(C`typeof\*(C'\fR keywords, since +\&\f(CW\*(C`inline\*(C'\fR is a standard keyword in \s-1ISO\s0 C99. +.IP "\fB\-fno\-builtin\fR" 4 +.IX Item "-fno-builtin" +.PD 0 +.IP "\fB\-fno\-builtin\-\fR\fIfunction\fR" 4 +.IX Item "-fno-builtin-function" +.PD +Don't recognize built-in functions that do not begin with +\&\fB_\|_builtin_\fR as prefix. +.Sp +\&\s-1GCC\s0 normally generates special code to handle certain built-in functions +more efficiently; for instance, calls to \f(CW\*(C`alloca\*(C'\fR may become single +instructions that adjust the stack directly, and calls to \f(CW\*(C`memcpy\*(C'\fR +may become inline copy loops. The resulting code is often both smaller +and faster, but since the function calls no longer appear as such, you +cannot set a breakpoint on those calls, nor can you change the behavior +of the functions by linking with a different library. +.Sp +With the \fB\-fno\-builtin\-\fR\fIfunction\fR option +only the built-in function \fIfunction\fR is +disabled. \fIfunction\fR must not begin with \fB_\|_builtin_\fR. If a +function is named this is not built-in in this version of \s-1GCC\s0, this +option is ignored. There is no corresponding +\&\fB\-fbuiltin\-\fR\fIfunction\fR option; if you wish to enable +built-in functions selectively when using \fB\-fno\-builtin\fR or +\&\fB\-ffreestanding\fR, you may define macros such as: +.Sp +.Vb 2 +\& #define abs(n) __builtin_abs ((n)) +\& #define strcpy(d, s) __builtin_strcpy ((d), (s)) +.Ve +.IP "\fB\-fhosted\fR" 4 +.IX Item "-fhosted" +Assert that compilation takes place in a hosted environment. This implies +\&\fB\-fbuiltin\fR. A hosted environment is one in which the +entire standard library is available, and in which \f(CW\*(C`main\*(C'\fR has a return +type of \f(CW\*(C`int\*(C'\fR. Examples are nearly everything except a kernel. +This is equivalent to \fB\-fno\-freestanding\fR. +.IP "\fB\-ffreestanding\fR" 4 +.IX Item "-ffreestanding" +Assert that compilation takes place in a freestanding environment. This +implies \fB\-fno\-builtin\fR. A freestanding environment +is one in which the standard library may not exist, and program startup may +not necessarily be at \f(CW\*(C`main\*(C'\fR. The most obvious example is an \s-1OS\s0 kernel. +This is equivalent to \fB\-fno\-hosted\fR. +.IP "\fB\-fms\-extensions\fR" 4 +.IX Item "-fms-extensions" +Accept some non-standard constructs used in Microsoft header files. +.IP "\fB\-trigraphs\fR" 4 +.IX Item "-trigraphs" +Support \s-1ISO\s0 C trigraphs. The \fB\-ansi\fR option (and \fB\-std\fR +options for strict \s-1ISO\s0 C conformance) implies \fB\-trigraphs\fR. +.IP "\fB\-no\-integrated\-cpp\fR" 4 +.IX Item "-no-integrated-cpp" +Performs a compilation in two passes: preprocessing and compiling. This +option allows a user supplied \*(L"cc1\*(R", \*(L"cc1plus\*(R", or \*(L"cc1obj\*(R" via the +\&\fB\-B\fR option. The user supplied compilation step can then add in +an additional preprocessing step after normal preprocessing but before +compiling. The default is to use the integrated cpp (internal cpp) +.Sp +The semantics of this option will change if \*(L"cc1\*(R", \*(L"cc1plus\*(R", and +\&\*(L"cc1obj\*(R" are merged. +.IP "\fB\-traditional\fR" 4 +.IX Item "-traditional" +.PD 0 +.IP "\fB\-traditional\-cpp\fR" 4 +.IX Item "-traditional-cpp" +.PD +Formerly, these options caused \s-1GCC\s0 to attempt to emulate a pre-standard +C compiler. They are now only supported with the \fB\-E\fR switch. +The preprocessor continues to support a pre-standard mode. See the \s-1GNU\s0 +\&\s-1CPP\s0 manual for details. +.IP "\fB\-fcond\-mismatch\fR" 4 +.IX Item "-fcond-mismatch" +Allow conditional expressions with mismatched types in the second and +third arguments. The value of such an expression is void. This option +is not supported for \*(C+. +.IP "\fB\-funsigned\-char\fR" 4 +.IX Item "-funsigned-char" +Let the type \f(CW\*(C`char\*(C'\fR be unsigned, like \f(CW\*(C`unsigned char\*(C'\fR. +.Sp +Each kind of machine has a default for what \f(CW\*(C`char\*(C'\fR should +be. It is either like \f(CW\*(C`unsigned char\*(C'\fR by default or like +\&\f(CW\*(C`signed char\*(C'\fR by default. +.Sp +Ideally, a portable program should always use \f(CW\*(C`signed char\*(C'\fR or +\&\f(CW\*(C`unsigned char\*(C'\fR when it depends on the signedness of an object. +But many programs have been written to use plain \f(CW\*(C`char\*(C'\fR and +expect it to be signed, or expect it to be unsigned, depending on the +machines they were written for. This option, and its inverse, let you +make such a program work with the opposite default. +.Sp +The type \f(CW\*(C`char\*(C'\fR is always a distinct type from each of +\&\f(CW\*(C`signed char\*(C'\fR or \f(CW\*(C`unsigned char\*(C'\fR, even though its behavior +is always just like one of those two. +.IP "\fB\-fsigned\-char\fR" 4 +.IX Item "-fsigned-char" +Let the type \f(CW\*(C`char\*(C'\fR be signed, like \f(CW\*(C`signed char\*(C'\fR. +.Sp +Note that this is equivalent to \fB\-fno\-unsigned\-char\fR, which is +the negative form of \fB\-funsigned\-char\fR. Likewise, the option +\&\fB\-fno\-signed\-char\fR is equivalent to \fB\-funsigned\-char\fR. +.IP "\fB\-fsigned\-bitfields\fR" 4 +.IX Item "-fsigned-bitfields" +.PD 0 +.IP "\fB\-funsigned\-bitfields\fR" 4 +.IX Item "-funsigned-bitfields" +.IP "\fB\-fno\-signed\-bitfields\fR" 4 +.IX Item "-fno-signed-bitfields" +.IP "\fB\-fno\-unsigned\-bitfields\fR" 4 +.IX Item "-fno-unsigned-bitfields" +.PD +These options control whether a bit-field is signed or unsigned, when the +declaration does not use either \f(CW\*(C`signed\*(C'\fR or \f(CW\*(C`unsigned\*(C'\fR. By +default, such a bit-field is signed, because this is consistent: the +basic integer types such as \f(CW\*(C`int\*(C'\fR are signed types. +.IP "\fB\-fwritable\-strings\fR" 4 +.IX Item "-fwritable-strings" +Store string constants in the writable data segment and don't uniquize +them. This is for compatibility with old programs which assume they can +write into string constants. +.Sp +Writing into string constants is a very bad idea; ``constants'' should +be constant. +.Sp +This option is deprecated. +.Sh "Options Controlling \*(C+ Dialect" +.IX Subsection "Options Controlling Dialect" +This section describes the command-line options that are only meaningful +for \*(C+ programs; but you can also use most of the \s-1GNU\s0 compiler options +regardless of what language your program is in. For example, you +might compile a file \f(CW\*(C`firstClass.C\*(C'\fR like this: +.PP +.Vb 1 +\& g++ -g -frepo -O -c firstClass.C +.Ve +.PP +In this example, only \fB\-frepo\fR is an option meant +only for \*(C+ programs; you can use the other options with any +language supported by \s-1GCC\s0. +.PP +Here is a list of options that are \fIonly\fR for compiling \*(C+ programs: +.IP "\fB\-fabi\-version=\fR\fIn\fR" 4 +.IX Item "-fabi-version=n" +Use version \fIn\fR of the \*(C+ \s-1ABI\s0. Version 2 is the version of the +\&\*(C+ \s-1ABI\s0 that first appeared in G++ 3.4. Version 1 is the version of +the \*(C+ \s-1ABI\s0 that first appeared in G++ 3.2. Version 0 will always be +the version that conforms most closely to the \*(C+ \s-1ABI\s0 specification. +Therefore, the \s-1ABI\s0 obtained using version 0 will change as \s-1ABI\s0 bugs +are fixed. +.Sp +The default is version 2. +.IP "\fB\-fno\-access\-control\fR" 4 +.IX Item "-fno-access-control" +Turn off all access checking. This switch is mainly useful for working +around bugs in the access control code. +.IP "\fB\-fcheck\-new\fR" 4 +.IX Item "-fcheck-new" +Check that the pointer returned by \f(CW\*(C`operator new\*(C'\fR is non-null +before attempting to modify the storage allocated. This check is +normally unnecessary because the \*(C+ standard specifies that +\&\f(CW\*(C`operator new\*(C'\fR will only return \f(CW0\fR if it is declared +\&\fB\f(BIthrow()\fB\fR, in which case the compiler will always check the +return value even without this option. In all other cases, when +\&\f(CW\*(C`operator new\*(C'\fR has a non-empty exception specification, memory +exhaustion is signalled by throwing \f(CW\*(C`std::bad_alloc\*(C'\fR. See also +\&\fBnew (nothrow)\fR. +.IP "\fB\-fconserve\-space\fR" 4 +.IX Item "-fconserve-space" +Put uninitialized or runtime-initialized global variables into the +common segment, as C does. This saves space in the executable at the +cost of not diagnosing duplicate definitions. If you compile with this +flag and your program mysteriously crashes after \f(CW\*(C`main()\*(C'\fR has +completed, you may have an object that is being destroyed twice because +two definitions were merged. +.Sp +This option is no longer useful on most targets, now that support has +been added for putting variables into \s-1BSS\s0 without making them common. +.IP "\fB\-fno\-const\-strings\fR" 4 +.IX Item "-fno-const-strings" +Give string constants type \f(CW\*(C`char *\*(C'\fR instead of type \f(CW\*(C`const +char *\*(C'\fR. By default, G++ uses type \f(CW\*(C`const char *\*(C'\fR as required by +the standard. Even if you use \fB\-fno\-const\-strings\fR, you cannot +actually modify the value of a string constant, unless you also use +\&\fB\-fwritable\-strings\fR. +.Sp +This option might be removed in a future release of G++. For maximum +portability, you should structure your code so that it works with +string constants that have type \f(CW\*(C`const char *\*(C'\fR. +.IP "\fB\-fno\-elide\-constructors\fR" 4 +.IX Item "-fno-elide-constructors" +The \*(C+ standard allows an implementation to omit creating a temporary +which is only used to initialize another object of the same type. +Specifying this option disables that optimization, and forces G++ to +call the copy constructor in all cases. +.IP "\fB\-fno\-enforce\-eh\-specs\fR" 4 +.IX Item "-fno-enforce-eh-specs" +Don't check for violation of exception specifications at runtime. This +option violates the \*(C+ standard, but may be useful for reducing code +size in production builds, much like defining \fB\s-1NDEBUG\s0\fR. The compiler +will still optimize based on the exception specifications. +.IP "\fB\-ffor\-scope\fR" 4 +.IX Item "-ffor-scope" +.PD 0 +.IP "\fB\-fno\-for\-scope\fR" 4 +.IX Item "-fno-for-scope" +.PD +If \fB\-ffor\-scope\fR is specified, the scope of variables declared in +a \fIfor-init-statement\fR is limited to the \fBfor\fR loop itself, +as specified by the \*(C+ standard. +If \fB\-fno\-for\-scope\fR is specified, the scope of variables declared in +a \fIfor-init-statement\fR extends to the end of the enclosing scope, +as was the case in old versions of G++, and other (traditional) +implementations of \*(C+. +.Sp +The default if neither flag is given to follow the standard, +but to allow and give a warning for old-style code that would +otherwise be invalid, or have different behavior. +.IP "\fB\-fno\-gnu\-keywords\fR" 4 +.IX Item "-fno-gnu-keywords" +Do not recognize \f(CW\*(C`typeof\*(C'\fR as a keyword, so that code can use this +word as an identifier. You can use the keyword \f(CW\*(C`_\|_typeof_\|_\*(C'\fR instead. +\&\fB\-ansi\fR implies \fB\-fno\-gnu\-keywords\fR. +.IP "\fB\-fno\-implicit\-templates\fR" 4 +.IX Item "-fno-implicit-templates" +Never emit code for non-inline templates which are instantiated +implicitly (i.e. by use); only emit code for explicit instantiations. +.IP "\fB\-fno\-implicit\-inline\-templates\fR" 4 +.IX Item "-fno-implicit-inline-templates" +Don't emit code for implicit instantiations of inline templates, either. +The default is to handle inlines differently so that compiles with and +without optimization will need the same set of explicit instantiations. +.IP "\fB\-fno\-implement\-inlines\fR" 4 +.IX Item "-fno-implement-inlines" +To save space, do not emit out-of-line copies of inline functions +controlled by \fB#pragma implementation\fR. This will cause linker +errors if these functions are not inlined everywhere they are called. +.IP "\fB\-fms\-extensions\fR" 4 +.IX Item "-fms-extensions" +Disable pedantic warnings about constructs used in \s-1MFC\s0, such as implicit +int and getting a pointer to member function via non-standard syntax. +.IP "\fB\-fno\-nonansi\-builtins\fR" 4 +.IX Item "-fno-nonansi-builtins" +Disable built-in declarations of functions that are not mandated by +\&\s-1ANSI/ISO\s0 C. These include \f(CW\*(C`ffs\*(C'\fR, \f(CW\*(C`alloca\*(C'\fR, \f(CW\*(C`_exit\*(C'\fR, +\&\f(CW\*(C`index\*(C'\fR, \f(CW\*(C`bzero\*(C'\fR, \f(CW\*(C`conjf\*(C'\fR, and other related functions. +.IP "\fB\-fno\-operator\-names\fR" 4 +.IX Item "-fno-operator-names" +Do not treat the operator name keywords \f(CW\*(C`and\*(C'\fR, \f(CW\*(C`bitand\*(C'\fR, +\&\f(CW\*(C`bitor\*(C'\fR, \f(CW\*(C`compl\*(C'\fR, \f(CW\*(C`not\*(C'\fR, \f(CW\*(C`or\*(C'\fR and \f(CW\*(C`xor\*(C'\fR as +synonyms as keywords. +.IP "\fB\-fno\-optional\-diags\fR" 4 +.IX Item "-fno-optional-diags" +Disable diagnostics that the standard says a compiler does not need to +issue. Currently, the only such diagnostic issued by G++ is the one for +a name having multiple meanings within a class. +.IP "\fB\-fpermissive\fR" 4 +.IX Item "-fpermissive" +Downgrade some diagnostics about nonconformant code from errors to +warnings. Thus, using \fB\-fpermissive\fR will allow some +nonconforming code to compile. +.IP "\fB\-frepo\fR" 4 +.IX Item "-frepo" +Enable automatic template instantiation at link time. This option also +implies \fB\-fno\-implicit\-templates\fR. +.IP "\fB\-fno\-rtti\fR" 4 +.IX Item "-fno-rtti" +Disable generation of information about every class with virtual +functions for use by the \*(C+ runtime type identification features +(\fBdynamic_cast\fR and \fBtypeid\fR). If you don't use those parts +of the language, you can save some space by using this flag. Note that +exception handling uses the same information, but it will generate it as +needed. +.IP "\fB\-fstats\fR" 4 +.IX Item "-fstats" +Emit statistics about front-end processing at the end of the compilation. +This information is generally only useful to the G++ development team. +.IP "\fB\-ftemplate\-depth\-\fR\fIn\fR" 4 +.IX Item "-ftemplate-depth-n" +Set the maximum instantiation depth for template classes to \fIn\fR. +A limit on the template instantiation depth is needed to detect +endless recursions during template class instantiation. \s-1ANSI/ISO\s0 \*(C+ +conforming programs must not rely on a maximum depth greater than 17. +.IP "\fB\-fuse\-cxa\-atexit\fR" 4 +.IX Item "-fuse-cxa-atexit" +Register destructors for objects with static storage duration with the +\&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR function rather than the \f(CW\*(C`atexit\*(C'\fR function. +This option is required for fully standards-compliant handling of static +destructors, but will only work if your C library supports +\&\f(CW\*(C`_\|_cxa_atexit\*(C'\fR. +.IP "\fB\-fno\-weak\fR" 4 +.IX Item "-fno-weak" +Do not use weak symbol support, even if it is provided by the linker. +By default, G++ will use weak symbols if they are available. This +option exists only for testing, and should not be used by end\-users; +it will result in inferior code and has no benefits. This option may +be removed in a future release of G++. +.IP "\fB\-nostdinc++\fR" 4 +.IX Item "-nostdinc++" +Do not search for header files in the standard directories specific to +\&\*(C+, but do still search the other standard directories. (This option +is used when building the \*(C+ library.) +.PP +In addition, these optimization, warning, and code generation options +have meanings only for \*(C+ programs: +.IP "\fB\-fno\-default\-inline\fR" 4 +.IX Item "-fno-default-inline" +Do not assume \fBinline\fR for functions defined inside a class scope. + Note that these +functions will have linkage like inline functions; they just won't be +inlined by default. +.IP "\fB\-Wabi\fR (\*(C+ only)" 4 +.IX Item "-Wabi ( only)" +Warn when G++ generates code that is probably not compatible with the +vendor-neutral \*(C+ \s-1ABI\s0. Although an effort has been made to warn about +all such cases, there are probably some cases that are not warned about, +even though G++ is generating incompatible code. There may also be +cases where warnings are emitted even though the code that is generated +will be compatible. +.Sp +You should rewrite your code to avoid these warnings if you are +concerned about the fact that code generated by G++ may not be binary +compatible with code generated by other compilers. +.Sp +The known incompatibilities at this point include: +.RS 4 +.IP "*" 4 +Incorrect handling of tail-padding for bit\-fields. G++ may attempt to +pack data into the same byte as a base class. For example: +.Sp +.Vb 2 +\& struct A { virtual void f(); int f1 : 1; }; +\& struct B : public A { int f2 : 1; }; +.Ve +.Sp +In this case, G++ will place \f(CW\*(C`B::f2\*(C'\fR into the same byte +as\f(CW\*(C`A::f1\*(C'\fR; other compilers will not. You can avoid this problem +by explicitly padding \f(CW\*(C`A\*(C'\fR so that its size is a multiple of the +byte size on your platform; that will cause G++ and other compilers to +layout \f(CW\*(C`B\*(C'\fR identically. +.IP "*" 4 +Incorrect handling of tail-padding for virtual bases. G++ does not use +tail padding when laying out virtual bases. For example: +.Sp +.Vb 3 +\& struct A { virtual void f(); char c1; }; +\& struct B { B(); char c2; }; +\& struct C : public A, public virtual B {}; +.Ve +.Sp +In this case, G++ will not place \f(CW\*(C`B\*(C'\fR into the tail-padding for +\&\f(CW\*(C`A\*(C'\fR; other compilers will. You can avoid this problem by +explicitly padding \f(CW\*(C`A\*(C'\fR so that its size is a multiple of its +alignment (ignoring virtual base classes); that will cause G++ and other +compilers to layout \f(CW\*(C`C\*(C'\fR identically. +.IP "*" 4 +Incorrect handling of bit-fields with declared widths greater than that +of their underlying types, when the bit-fields appear in a union. For +example: +.Sp +.Vb 1 +\& union U { int i : 4096; }; +.Ve +.Sp +Assuming that an \f(CW\*(C`int\*(C'\fR does not have 4096 bits, G++ will make the +union too small by the number of bits in an \f(CW\*(C`int\*(C'\fR. +.IP "*" 4 +Empty classes can be placed at incorrect offsets. For example: +.Sp +.Vb 1 +\& struct A {}; +.Ve +.Sp +.Vb 4 +\& struct B { +\& A a; +\& virtual void f (); +\& }; +.Ve +.Sp +.Vb 1 +\& struct C : public B, public A {}; +.Ve +.Sp +G++ will place the \f(CW\*(C`A\*(C'\fR base class of \f(CW\*(C`C\*(C'\fR at a nonzero offset; +it should be placed at offset zero. G++ mistakenly believes that the +\&\f(CW\*(C`A\*(C'\fR data member of \f(CW\*(C`B\*(C'\fR is already at offset zero. +.IP "*" 4 +Names of template functions whose types involve \f(CW\*(C`typename\*(C'\fR or +template template parameters can be mangled incorrectly. +.Sp +.Vb 2 +\& template +\& void f(typename Q::X) {} +.Ve +.Sp +.Vb 2 +\& template