------- Comment #1 from fxcoudert at gcc dot gnu dot org 2007-08-08 16:50
-------
What do you think about the following doc patch? I'm CCing Thomas Koenig
because he's the one who implemented SIZEOF, IIRC.
Index: intrinsic.texi
===================================================================
--- intrinsic.texi (revision 127293)
+++ intrinsic.texi (working copy)
@@ -9395,12 +9395,14 @@ Intrinsic function
@end multitable
@item @emph{Return value}:
-The return value is of type integer. Its value is the number of bytes
+The return value is of type integer and of a system-dependent kind
[EMAIL PROTECTED] such that variables of type @code{INTEGER(K)} have the same
size
+as C pointers (@code{sizeof(void *)}). Its value is the number of bytes
occupied by the argument. If the argument has the @code{POINTER}
attribute, the number of bytes of the storage area pointed to is
returned. If the argument is of a derived type with @code{POINTER} or
[EMAIL PROTECTED] components, the return value doesn't account for
-the sizes of the data pointed to by these components.
[EMAIL PROTECTED] components, the return value doesn't account for the
+sizes of the data pointed to by these components.
@item @emph{Example}:
@smallexample
PS: in virtually all cases, (void *) and size_t will have the same size;
actually, the front-end is such that if they ever differed, the result of
SIZEOF would have the size of (void *), not size_t (which the compiler doesn't
know). Annoying, but true. ;-)
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org, tkoenig at gcc dot gnu
| |dot org
AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot
|dot org |org
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Keywords| |patch
Last reconfirmed|0000-00-00 00:00:00 |2007-08-08 16:50:56
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32902