- NetBSD Manual Pages
__BUILTIN_OBJECT_SIZ... NetBSD Library Functions Manual__BUILTIN_OBJECT_SIZ...
Powered by man-cgi (2021-06-01).
Maintained for NetBSD
by Kimmo Suominen.
Based on man-cgi by Panagiotis Christias.
__builtin_object_size -- return the size of the given object
__builtin_object_size(void *ptr, int type);
The __builtin_object_size() function is a gcc(1) built-in function that
returns the size of the ptr object if known at compile time and the
object does not have any side effects.
If the size of the object is not known or it has side effects the
__builtin_object_size() function returns:
(size_t)-1 for type 0 and 1.
(size_t)0 for type 2 and 3.
If the size of the object is known, then the __builtin_object_size()
function returns the maximum size of all the objects that the compiler
knows that they can be pointed to by ptr when type & 2 == 0, and the min-
imum size when type & 2 != 0.
gcc(1), __builtin_return_address(3), attribute(3), ssp(3)
The __builtin_object_size() appeared in GCC 4.1.
This is a non-standard, compiler-specific extension.
NetBSD 6.0 December 19, 2010 NetBSD 6.0