aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2009-03-18 13:48:07 -0400
committerSandra Loosemore <sandra@gcc.gnu.org>2009-03-18 13:48:07 -0400
commit332459cd59f95ea89f97f8ddaab6a62e213c1981 (patch)
tree03aad01eb4f3ce8c2d02db035f69341a98e2bb47 /gcc/doc
parentd130d647f6ea66c2773f822f8f834a57b00fb817 (diff)
downloadgcc-332459cd59f95ea89f97f8ddaab6a62e213c1981.zip
gcc-332459cd59f95ea89f97f8ddaab6a62e213c1981.tar.gz
gcc-332459cd59f95ea89f97f8ddaab6a62e213c1981.tar.bz2
invoke.texi (Code Gen Options): Expand discussion of -fno-common.
2009-03-18 Sandra Loosemore <sandra@codesourcery.com> gcc/ * doc/invoke.texi (Code Gen Options): Expand discussion of -fno-common. From-SVN: r144940
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/invoke.texi25
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 275986c..277574a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -15709,12 +15709,25 @@ Use it to conform to a non-default application binary interface.
@item -fno-common
@opindex fno-common
-In C, allocate even uninitialized global variables in the data section of the
-object file, rather than generating them as common blocks. This has the
-effect that if the same variable is declared (without @code{extern}) in
-two different compilations, you will get an error when you link them.
-The only reason this might be useful is if you wish to verify that the
-program will work on other systems which always work this way.
+In C code, controls the placement of uninitialized global variables.
+Unix C compilers have traditionally permitted multiple definitions of
+such variables in different compilation units by placing the variables
+in a common block.
+This is the behavior specified by @option{-fcommon}, and is the default
+for GCC on most targets.
+On the other hand, this behavior is not required by ISO C, and on some
+targets may carry a speed or code size penalty on variable references.
+The @option{-fno-common} option specifies that the compiler should place
+uninitialized global variables in the data section of the object file,
+rather than generating them as common blocks.
+This has the effect that if the same variable is declared
+(without @code{extern}) in two different compilations,
+you will get a multiple-definition error when you link them.
+In this case, you must compile with @option{-fcommon} instead.
+Compiling with @option{-fno-common} is useful on targets for which
+it provides better performance, or if you wish to verify that the
+program will work on other systems which always treat uninitialized
+variable declarations this way.
@item -fno-ident
@opindex fno-ident