bug-gnupress
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DOCPATCH] Re: [Bug-gnupress] Suggested changes to gcc010.pdf


From: Simon Law
Subject: [DOCPATCH] Re: [Bug-gnupress] Suggested changes to gcc010.pdf
Date: Tue, 13 May 2003 12:47:24 -0400
User-agent: Mutt/1.3.28i

Oops.  Forgot to change the heading.

2003-05-10  Rob Hughes  <address@hidden>

        * doc/extend.texi: Fixes to spelling, grammar, and diction.

--- extend.texi Sun May  4 18:24:52 2003
+++ fixed.extend.texi   Sat May 10 13:52:54 2003
@@ -365,7 +365,7 @@
 
 @item
 @cite{The definitions for @code{__DATE__} and @code{__TIME__} when
-respectively, the date and time of translation are not available (6.10.8).}
+the date and time of translation, respectively, are not available (6.10.8).}
 
 If the date and time are not available, @code{__DATE__} expands to
 @address@hidden"??? ?? ????"}} and @code{__TIME__} expands to
@@ -410,8 +410,8 @@
 
 @opindex pedantic
 GNU C provides several language features not found in ISO standard 
address@hidden
-(The @option{-pedantic} option directs GCC to print a warning message if
-any of these features is used.)  To test for the availability of these
+The @option{-pedantic} option directs GCC to print a warning message if
+any of these features is used.  To test for the availability of these
 features in conditional compilation, check for a predefined macro
 @code{__GNUC__}, which is always defined under address@hidden
 
@@ -419,8 +419,8 @@
 also available in C++.  @xref{C++ Extensions,,Extensions to the
 C++ Language}, for extensions that apply @emph{only} to C++.
 
-Some features that are in ISO C99 but not C89 or C++ are also, as
-extensions, accepted by GCC in C89 mode and in C++.
+Some features that are in ISO C99 but not C89 or C++ are also 
+accepted as extensions by GCC in C89 mode and in C++.
 
 @menu
 * Statement Exprs::     Putting statements and declarations inside expressions.
@@ -493,7 +493,7 @@
 
 Recall that a compound statement is a sequence of statements surrounded
 by braces; in this construct, parentheses go around the braces.  For
-example:
+example,
 
 @example
 (@{ int y = foo (); int z;
@@ -503,13 +503,13 @@
 @end example
 
 @noindent
-is a valid (though slightly more complex than necessary) expression
+is a valid (though needlessly complex) expression
 for the absolute value of @code{foo ()}.
 
 The last thing in the compound statement should be an expression
 followed by a semicolon; the value of this subexpression serves as the
 value of the entire construct.  (If you use some other kind of statement
-last within the braces, the construct has type @code{void}, and thus
+last within the braces, the construct has type @code{void} and thus
 effectively no value.)
 
 This feature is especially useful in making macro definitions ``safe'' (so
@@ -533,30 +533,30 @@
   (@{int _a = (a), _b = (b); _a > _b ? _a : _b; @})
 @end example
 
+If you don't know the type of the operand, you can still do this, but you
+must use @code{typeof} (@pxref{Typeof}).
+
 Embedded statements are not allowed in constant expressions, such as
 the value of an enumeration constant, the width of a bit-field, or
 the initial value of a static variable.
 
-If you don't know the type of the operand, you can still do this, but you
-must use @code{typeof} (@pxref{Typeof}).
-
 Statement expressions are not supported fully in G++, and their fate
-there is unclear.  (It is possible that they will become fully supported
+there is unclear.  It is possible that they will become fully supported
 at some point, or that they will be deprecated, or that the bugs that
-are present will continue to exist indefinitely.)  Presently, statement
+are present will continue to exist indefinitely.  Presently, statement
 expressions do not work well as default arguments.
 
 In addition, there are semantic issues with statement-expressions in
 C++.  If you try to use statement-expressions instead of inline
 functions in C++, you may be surprised at the way object destruction is
-handled.  For example:
+handled.  For example,
 
 @example
 #define foo(a)  (@{int b = (a); b + 3; @})
 @end example
 
 @noindent
-does not work the same way as:
+does not work the same way as
 
 @example
 inline int foo(int a) @{ int b = a; return b + 3; @}
@@ -600,8 +600,9 @@
 expression, right after the @samp{(@{}, before any ordinary
 declarations.
 
-The label declaration defines the label @emph{name}, but does not define
-the label itself.  You must do this in the usual way, with
+The label declaration indicates that the identifier @emph{name} 
+will be used as a label, but it does not actually define
+the label.  You must do this in the usual way, with
 @address@hidden:}, within the statements of the statement expression.
 
 The local label feature is useful because statement expressions are
@@ -648,7 +649,7 @@
 ptr = &&foo;
 @end example
 
-To use these values, you need to be able to jump to one.  This is done
+To use these values, you need to be able to jump to them.  This is done
 with the computed goto address@hidden analogous feature in
 Fortran is called an assigned goto, but that name seems inappropriate in
 C, where one can do more than simply store label addresses in label
@@ -687,10 +688,11 @@
 The labels within the interpreter function can be stored in the
 threaded code for super-fast dispatching.
 
-You may not use this mechanism to jump to code in a different function.
-If you do that, totally unpredictable things will happen.  The best way to
+You cannot use this mechanism to jump to code in a different function.
+If you try to do that, totally unpredictable things will happen.  
+The best way to
 avoid this is to store the label address only in automatic variables and
-never pass it as an argument.
+never to pass it as an argument.
 
 An alternate way to write the above example is
 
@@ -702,7 +704,7 @@
 
 @noindent
 This is more friendly to code living in shared libraries, as it reduces
-the number of dynamic relocations that are needed, and by consequence,
+the number of dynamic relocations that are needed, and, by consequence,
 allows the data to be read-only.
 
 @node Nested Functions
@@ -712,7 +714,7 @@
 @cindex thunks
 
 A @dfn{nested function} is a function defined inside another function.
-(Nested functions are not supported for GNU C++.)  The nested function's
+Nested functions are not supported for GNU C++.  The nested function's
 name is local to the block where it is defined.  For example, here we
 define a nested function named @code{square}, and call it twice:
 
@@ -763,22 +765,24 @@
 @}
 @end example
 
address@hidden
 Here, the function @code{intermediate} receives the address of
 @code{store} as an argument.  If @code{intermediate} calls @code{store},
 the arguments given to @code{store} are used to store into @code{array}.
 But this technique works only so long as the containing function
 (@code{hack}, in this example) does not exit.
-
 If you try to call the nested function through its address after the
-containing function has exited, all hell will break loose.  If you try
-to call it after a containing scope level has exited, and if it refers
+containing function has exited, all hell will break loose.  
+
+If you try to call a nested function after a containing 
+scope level has exited, and if it refers
 to some of the variables that are no longer in scope, you may be lucky,
 but it's not wise to take the risk.  If, however, the nested function
 does not refer to anything that has gone out of scope, you should be
 safe.
 
 GCC implements taking the address of a nested function using a technique
-called @dfn{trampolines}.  A paper describing them is available as
+called @dfn{trampolines}.  A paper describing this technique is available as
 
 @noindent
 @uref{http://people.debian.org/~aaronl/Usenix88-lexic.pdf}.
@@ -842,8 +846,8 @@
 @cindex forwarding calls
 
 Using the built-in functions described below, you can record
-the arguments a function received, and call another function
-with the same arguments, without knowing the number or types
+the arguments a function received and call another function
+with the same arguments without knowing the number or types
 of the arguments.
 
 You can also record the return value of that function call,
@@ -856,7 +860,7 @@
 describing how to perform a call with the same arguments as were passed
 to the current function.
 
-The function saves the arg pointer register, structure value address,
+The function saves the arg pointer register, the structure value address,
 and all registers that might be used to pass arguments to a function
 into a block of memory allocated on the stack.  Then it returns the
 address of that block.
@@ -894,7 +898,7 @@
 @cindex macros, types of arguments
 
 Another way to refer to the type of an expression is with @code{typeof}.
-The syntax of using of this keyword looks like @code{sizeof}, but the
+The syntax for the use of this keyword looks like @code{sizeof}, but the
 construct acts semantically like a type name defined with @code{typedef}.
 
 There are two ways of writing the argument to @code{typeof}: with an
@@ -1165,7 +1169,7 @@
 You can use these types in arithmetic like any other integer types.
 Addition, subtraction, and bitwise boolean operations on these types
 are open-coded on all types of machines.  Multiplication is open-coded
-if the machine supports fullword-to-doubleword a widening multiply
+if the machine supports fullword-to-doubleword, a widening multiply
 instruction.  Division and shifts are open-coded only on machines that
 provide special support.  The operations that are not open-coded use
 special library routines that come with address@hidden
@@ -1185,8 +1189,8 @@
 @cindex @code{__complex__} keyword
 
 ISO C99 supports complex floating data types, and as an extension GCC
-supports them in C89 mode and in C++, and supports complex integer data
-types which are not part of ISO C99.  You can declare complex types
+supports them in C89 mode and in C++.  GCC also supports complex integer data
+types, which are not part of ISO C99.  You can declare complex types
 using the keyword @code{_Complex}.  As an extension, the older GNU
 keyword @code{__complex__} is also supported.
 
@@ -1242,7 +1246,7 @@
 decimal notation, such as @code{1.55e1}, but also numbers such as
 @code{0x1.fp3} written in hexadecimal format.  As a GNU extension, GCC
 supports this in C89 mode (except in some cases when strictly
-conforming) and in C++.  In that format the
+conforming) and in C++.  In hex float format, the
 @samp{0x} hex introducer and the @samp{p} or @samp{P} exponent field are
 mandatory.  The exponent is a decimal number that indicates the power of
 2 by which the significant part will be multiplied.  Thus @samp{0x1.f} is
@@ -1283,10 +1287,11 @@
 thisline->length = this_length;
 @end example
 
address@hidden
 In ISO C90, you would have to give @code{contents} a length of 1, which
 means either you waste space or complicate the argument to @code{malloc}.
 
-In ISO C99, you would use a @dfn{flexible array member}, which is
+In ISO C99, you could use a @dfn{flexible array member}, which is
 slightly different in syntax and semantics:
 
 @itemize @bullet
@@ -1311,15 +1316,15 @@
 @end itemize
 
 GCC versions before 3.0 allowed zero-length arrays to be statically
-initialized, as if they were flexible arrays.  In addition to those
-cases that were useful, it also allowed initializations in situations
-that would corrupt later data.  Non-empty initialization of zero-length
+initialized, as if they were flexible arrays.  Though in some
+cases this technique was useful, in other situations these initializations 
+would corrupt later data.  Non-empty initialization of zero-length
 arrays is now treated like any case where there are more initializer
 elements than the array holds, in that a suitable warning about "excess
 elements in array" is given, and the excess elements (all of them, in
 this case) are ignored.
 
-Instead GCC allows static initialization of flexible array members.
+Instead, GCC allows static initialization of flexible array members.
 This is equivalent to defining a new structure containing the original
 structure followed by an array of sufficient size to contain the data.
 I.e.@: in the following, @code{f1} is constructed as if it were declared
@@ -1416,9 +1421,9 @@
 There are other differences between these two methods.  Space allocated
 with @code{alloca} exists until the containing @emph{function} returns.
 The space for a variable-length array is deallocated as soon as the array
-name's scope ends.  (If you use both variable-length arrays and
+name's scope ends.  If you use both variable-length arrays and
 @code{alloca} in the same function, deallocation of a variable-length array
-will also deallocate anything more recently allocated with @code{alloca}.)
+will also deallocate anything more recently allocated with @code{alloca}.
 
 You can also use variable-length arrays as arguments to functions:
 
@@ -1466,8 +1471,8 @@
 
 In the ISO C standard of 1999, a macro can be declared to accept a
 variable number of arguments much as a function can.  The syntax for
-defining the macro is similar to that of a function.  Here is an
-example:
+defining the macro is similar to that of a function definition.  
+Here is an example:
 
 @smallexample
 #define debug(format, ...) fprintf (stderr, format, __VA_ARGS__)
@@ -1479,8 +1484,8 @@
 tokens replaces the identifier @code{__VA_ARGS__} in the macro body
 wherever it appears.  See the CPP manual for more information.
 
-GCC has long supported variadic macros, and used a different syntax that
-allowed you to give a name to the variable arguments just like any other
+GCC has long supported variadic macros, and it has used a different syntax that
+allows you to give a name to the variable arguments just like any other
 argument.  Here is an example:
 
 @example
@@ -1503,7 +1508,7 @@
 @end example
 
 GNU CPP permits you to completely omit the variable arguments in this
-way.  In the above examples, the compiler would complain, though since
+way.  In the above examples, the compiler would complain, though, since
 the expansion of the macro still has the extra comma after the format
 string.
 
@@ -1514,6 +1519,7 @@
 #define debug(format, ...) fprintf (stderr, format, ## __VA_ARGS__)
 @end smallexample
 
address@hidden
 and if the variable arguments are omitted or empty, the @samp{##}
 operator causes the preprocessor to remove the comma before it.  If you
 do provide some variable arguments in your macro invocation, GNU CPP
@@ -1557,8 +1563,8 @@
 
 @cindex subscripting and function values
 In ISO C99, arrays that are not lvalues still decay to pointers, and
-may be subscripted, although they may not be modified or used after
-the next sequence point and the unary @samp{&} operator may not be
+they may be subscripted, although they may not be modified or used after
+the next sequence point, and the unary @samp{&} operator may not be
 applied to them.  As an extension, GCC allows such arrays to be
 subscripted in C89 mode, though otherwise they do not decay to
 pointers outside C99 mode.  For example,
@@ -1666,7 +1672,7 @@
 to a cast.
 
 As a GNU extension, GCC allows initialization of objects with static storage
-duration by compound literals (which is not possible in ISO C99, because
+duration by compound literals (which is not possible in ISO C99 because
 the initializer is not a constant).
 It is handled as if the object was initialized only with the bracket
 enclosed list if compound literal's and object types match.
@@ -1723,7 +1729,7 @@
 initialized is automatic.
 
 An alternative syntax for this which has been obsolete since GCC 2.5 but
-GCC still accepts is to write @address@hidden before the element
+which GCC still accepts is to write @address@hidden before the element
 value, with no @samp{=}.
 
 To initialize a range of elements to the same value, write
@@ -1735,10 +1741,9 @@
 @end example
 
 @noindent
-If the value in it has side-effects, the side-effects will happen only once,
-not for each initialized field by the range initializer.
-
address@hidden
+If the expression used to initialize the range has side-effects, 
+the side-effects will happen only once,
+not once for each field initialized by the range initializer.
 Note that the length of the array is the highest value specified
 plus one.
 
@@ -1819,8 +1824,8 @@
 You can also write a series of @address@hidden and
 @address@hidden designators before an @samp{=} to specify a
 nested subobject to initialize; the list is taken relative to the
-subobject corresponding to the closest surrounding brace pair.  For
-example, with the @samp{struct point} declaration above:
+subobject corresponding to the closest surrounding brace pair.  Here is an 
+example, using the @samp{struct point} declaration above:
 
 @smallexample
 struct point ptarray[10] = @{ [2].y = yv2, [2].x = xv2, [0].x = xv0 @};
@@ -1918,7 +1923,7 @@
 
 ISO C99 and ISO C++ allow declarations and code to be freely mixed
 within compound statements.  As an extension, GCC also allows this in
-C89 mode.  For example, you could do:
+C89 mode.  For example, you could do this:
 
 @example
 int i;
@@ -1961,7 +1966,7 @@
 @code{unused}, @code{deprecated}, @code{weak}, @code{malloc},
 @code{alias}, and @code{nonnull}.  Several other attributes are defined
 for functions on particular target systems.  Other attributes, including
address@hidden are supported for variables declarations
address@hidden, are supported for variables declarations
 (@pxref{Variable Attributes}) and for types (@pxref{Type Attributes}).
 
 You may also specify attributes with @samp{__} preceding and following




reply via email to

[Prev in Thread] Current Thread [Next in Thread]