The @code{alloc_size} variable attribute may be applied to the declaration
of a pointer to a function that returns a pointer and takes at least one
argument of an integer type. It indicates that the returned pointer points
-to an object whose size is given by the function argument at @var{position-1},
+to an object whose size is given by the function argument at @var{position},
or by the product of the arguments at @var{position-1} and @var{position-2}.
Meaningful sizes are positive values less than @code{PTRDIFF_MAX}. Other
-sizes are disagnosed when detected. GCC uses this information to improve
+sizes are diagnosed when detected. GCC uses this information to improve
the results of @code{__builtin_object_size}.
For instance, the following declarations