OSDN Git Service

* doc/options.texi (Var): Document effects of Defer.
[pf3gnuchains/gcc-fork.git] / gcc / doc / standards.texi
index ddee01a..59fbf03 100644 (file)
@@ -1,4 +1,5 @@
-@c Copyright (C) 2000, 2001, 2002, 2004 Free Software Foundation, Inc.
+@c Copyright (C) 2000, 2001, 2002, 2004, 2006, 2007, 2008, 2010
+@c Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
 
@@ -32,11 +33,15 @@ with some exceptions, and possibly with some extensions.
 @cindex C99
 @cindex ISO C9X
 @cindex C9X
+@cindex ISO C1X
+@cindex C1X
 @cindex Technical Corrigenda
 @cindex TC1
 @cindex Technical Corrigendum 1
 @cindex TC2
 @cindex Technical Corrigendum 2
+@cindex TC3
+@cindex Technical Corrigendum 3
 @cindex AMD1
 @cindex freestanding implementation
 @cindex freestanding environment
@@ -60,7 +65,7 @@ This standard, in both its forms, is commonly known as @dfn{C89}, or
 occasionally as @dfn{C90}, from the dates of ratification.  The ANSI
 standard, but not the ISO standard, also came with a Rationale
 document.  To select this standard in GCC, use one of the options
-@option{-ansi}, @option{-std=c89} or @option{-std=iso9899:1990}; to obtain
+@option{-ansi}, @option{-std=c90} or @option{-std=iso9899:1990}; to obtain
 all the diagnostics required by the standard, you should also specify
 @option{-pedantic} (or @option{-pedantic-errors} if you want them to be
 errors rather than warnings).  @xref{C Dialect Options,,Options
@@ -86,9 +91,13 @@ standard, use @option{-std=c99} or @option{-std=iso9899:1999}.  (While in
 development, drafts of this standard version were referred to as
 @dfn{C9X}.)
 
-Errors in the 1999 ISO C standard were corrected in two Technical
-Corrigenda published in 2001 and 2004.  GCC does not support the uncorrected
-version.
+Errors in the 1999 ISO C standard were corrected in three Technical
+Corrigenda published in 2001, 2004 and 2007.  GCC does not support the
+uncorrected version.
+
+A fourth version of the C standard, known as @dfn{C1X}, is under
+development; GCC has limited preliminary support for parts of this
+standard, enabled with @option{-std=c1x}.
 
 By default, GCC provides some extensions to the C language that on
 rare occasions conflict with the C standard.  @xref{C
@@ -96,12 +105,13 @@ Extensions,,Extensions to the C Language Family}.  Use of the
 @option{-std} options listed above will disable these extensions where
 they conflict with the C standard version selected.  You may also
 select an extended version of the C language explicitly with
-@option{-std=gnu89} (for C89 with GNU extensions) or @option{-std=gnu99}
-(for C99 with GNU extensions).  The default, if no C language dialect
-options are given, is @option{-std=gnu89}; this will change to
+@option{-std=gnu90} (for C90 with GNU extensions), @option{-std=gnu99}
+(for C99 with GNU extensions) or @option{-std=gnu1x} (for C1X with GNU
+extensions).  The default, if no C language dialect
+options are given, is @option{-std=gnu90}; this will change to
 @option{-std=gnu99} in some future release when the C99 support is
 complete.  Some features that are part of the C99 standard are
-accepted as extensions in C89 mode.
+accepted as extensions in C90 mode.
 
 The ISO C standard defines (in clause 4) two classes of conforming
 implementation.  A @dfn{conforming hosted implementation} supports the
@@ -175,12 +185,12 @@ warnings).
 The ISO C++ committee is working on a new ISO C++ standard, dubbed
 C++0x, that is intended to be published by 2009. C++0x contains several
 changes to the C++ language, some of which have been implemented in an
-experimental C++0x mode in GCC. The C++0x mode in GCC tracks the draft
+experimental C++0x mode in GCC@. The C++0x mode in GCC tracks the draft
 working paper for the C++0x standard; the latest working paper is
 available on the ISO C++ committee's web site at
-@uref{http://www.open-std.org/jtc1/sc22/wg21/}. For information
+@uref{http://www.open-std.org/@/jtc1/@/sc22/@/wg21/}. For information
 regarding the C++0x features available in the experimental C++0x mode,
-see @uref{http://gcc.gnu.org/gcc-4.3/cxx0x_status.html}. To select this
+see @uref{http://gcc.gnu.org/projects/@/cxx0x.html}. To select this
 standard in GCC, use the option @option{-std=c++0x}; to obtain all the
 diagnostics required by the standard, you should also specify
 @option{-pedantic} (or @option{-pedantic-errors} if you want them to be
@@ -198,31 +208,68 @@ no C++ language dialect options are given, is @option{-std=gnu++98}.
 @cindex Objective-C
 @cindex Objective-C++
 
-There is no formal written standard for Objective-C or Objective-C++@.  The most
-authoritative manual is ``Object-Oriented Programming and the
-Objective-C Language'', available at a number of web sites:
+GCC supports ``traditional'' Objective-C (also known as ``Objective-C
+1.0'') and contains support for the Objective-C exception and
+synchronization syntax.  It has also support for a number of
+``Objective-C 2.0'' language extensions, including properties, fast
+enumeration (only for Objective-C), method attributes and the
+@@optional and @@required keywords in protocols.  GCC supports
+Objective-C++ and features available in Objective-C are also available
+in Objective-C++@.
+
+GCC by default uses the GNU Objective-C runtime library, which is part
+of GCC and is not the same as the Apple/NeXT Objective-C runtime
+library used on Apple systems.  There are a number of differences
+documented in this manual.  The options @option{-fgnu-runtime} and
+@option{-fnext-runtime} allow you to switch between producing output
+that works with the GNU Objective-C runtime library and output that
+works with the Apple/NeXT Objective-C runtime library.
 
+There is no formal written standard for Objective-C or Objective-C++@.
+The authoritative manual on traditional Objective-C (1.0) is
+``Object-Oriented Programming and the Objective-C Language'',
+available at a number of web sites:
 @itemize
 @item
-@uref{http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/}
-is a recent (and periodically updated) version;
+@uref{http://www.gnustep.org/@/resources/@/documentation/@/ObjectivCBook.pdf}
+is the original NeXTstep document;
 @item
-@uref{http://www.toodarkpark.org/computers/objc/}
-is an older example;
+@uref{http://objc.toodarkpark.net}
+is the same document in another format;
 @item
-@uref{http://www.gnustep.org}
-and
-@uref{http://gcc.gnu.org/readings.html}
-have additional useful information.
+@uref{http://developer.apple.com/@/mac/@/library/@/documentation/@/Cocoa/@/Conceptual/@/ObjectiveC/}
+has an updated version but make sure you search for ``Object Oriented Programming and the Objective-C Programming Language 1.0'',
+not documentation on the newer ``Objective-C 2.0'' language
+@end itemize
+
+The Objective-C exception and synchronization syntax (that is, the
+keywords @@try, @@throw, @@catch, @@finally and @@synchronized) is
+supported by GCC and is enabled with the option
+@option{-fobjc-exceptions}.  The syntax is briefly documented in this
+manual and in the Objective-C 2.0 manuals from Apple.
+
+The Objective-C 2.0 language extensions and features are automatically
+enabled; they include properties (via the @@property, @@synthesize and
+@@dynamic keywords), fast enumeration (not available in
+Objective-C++), attributes for methods (such as deprecated, noreturn,
+sentinel, format), the unused attribute for method arguments, the
+@@package keyword for instance variables and the @@optional and
+@@required keywords in protocols.  You can disable all these
+Objective-C 2.0 language extensions with the option
+@option{-fobjc-std=objc1}, which causes the compiler to recognize the
+same Objective-C language syntax recognized by GCC 4.0, and to produce
+an error if one of the new features is used.
+
+GCC has currently no support for non-fragile instance variables.
+
+The authoritative manual on Objective-C 2.0 is available from Apple:
+@itemize
+@item
+@uref{http://developer.apple.com/@/mac/@/library/@/documentation/@/Cocoa/@/Conceptual/@/ObjectiveC/}
 @end itemize
 
-@section Treelang language
-@cindex treelang
-There is no standard for treelang, which is a sample language front end
-for GCC@.  Its only purpose is as a sample for people wishing to write a
-new language for GCC@.  The language is documented in
-@file{gcc/treelang/treelang.texi} which can be turned into info or
-HTML format.
+For more information concerning the history of Objective-C that is
+available online, see @uref{http://gcc.gnu.org/readings.html}
 
 @xref{Top, GNAT Reference Manual, About This Guide, gnat_rm,
 GNAT Reference Manual}, for information on standard