This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.15-295-ged58a00
- From: jsm28 at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 5 Mar 2012 15:04:18 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.15-295-ged58a00
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via ed58a00f9b76d18a6917eaf08585648182f104f7 (commit)
from b945857907e4c127f559818a5a98a56fcebc0d48 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ed58a00f9b76d18a6917eaf08585648182f104f7
commit ed58a00f9b76d18a6917eaf08585648182f104f7
Author: Joseph Myers <joseph@codesourcery.com>
Date: Mon Mar 5 15:03:57 2012 +0000
Reduce discussion of types to which size_t may be equivalent.
diff --git a/ChangeLog b/ChangeLog
index 6e4f7c4..38772bb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-05 Joseph Myers <joseph@codesourcery.com>
+
+ * manual/lang.texi (size_t): Note types to which size_t may be
+ equivalent with the GNU C Library, but do not describe when
+ differences between them are significant.
+
2012-03-05 Andreas Jaeger <aj@suse.de>
* sysdeps/i386/fpu/libm-test-ulps: Update.
diff --git a/manual/lang.texi b/manual/lang.texi
index 2a73c72..6cb7371 100644
--- a/manual/lang.texi
+++ b/manual/lang.texi
@@ -629,27 +629,13 @@ This is an unsigned integer type used to represent the sizes of objects.
The result of the @code{sizeof} operator is of this type, and functions
such as @code{malloc} (@pxref{Unconstrained Allocation}) and
@code{memcpy} (@pxref{Copying and Concatenation}) accept arguments of
-this type to specify object sizes.
+this type to specify object sizes. On systems using @theglibc{}, this
+will be @w{@code{unsigned int}} or @w{@code{unsigned long int}}.
@strong{Usage Note:} @code{size_t} is the preferred way to declare any
arguments or variables that hold the size of an object.
@end deftp
-In the GNU system @code{size_t} is equivalent to either
-@w{@code{unsigned int}} or @w{@code{unsigned long int}}. These types
-have identical properties on the GNU system and, for most purposes, you
-can use them interchangeably. However, they are distinct as data types,
-which makes a difference in certain contexts.
-
-For example, when you specify the type of a function argument in a
-function prototype, it makes a difference which one you use. If the
-system header files declare @code{malloc} with an argument of type
-@code{size_t} and you declare @code{malloc} with an argument of type
-@code{unsigned int}, you will get a compilation error if @code{size_t}
-happens to be @code{unsigned long int} on your system. To avoid any
-possibility of error, when a function argument or value is supposed to
-have type @code{size_t}, never declare its type in any other way.
-
@strong{Compatibility Note:} Implementations of C before the advent of
@w{ISO C} generally used @code{unsigned int} for representing object sizes
and @code{int} for pointer subtraction results. They did not
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
manual/lang.texi | 18 ++----------------
2 files changed, 8 insertions(+), 16 deletions(-)
hooks/post-receive
--
GNU C Library master sources