public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* sizeof() return type ?
@ 2006-06-22 19:48 Darryl Miles
  2006-06-22 20:07 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Darryl Miles @ 2006-06-22 19:48 UTC (permalink / raw)
  To: gcc-help


This one is taxing me, what is the correct type returned by the built in 
sizeof() operator ?

int ?
unsigned int ?
size_t ?
ssize_t ?

Where does size_t and ssize_t originate from ?  ANSI/stdio ?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sizeof() return type ?
  2006-06-22 19:48 sizeof() return type ? Darryl Miles
@ 2006-06-22 20:07 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2006-06-22 20:07 UTC (permalink / raw)
  To: Darryl Miles; +Cc: gcc-help

Darryl Miles <darryl-mailinglists@netbauds.net> writes:

> This one is taxing me, what is the correct type returned by the built
> in sizeof() operator ?
> 
> int ?
> unsigned int ?
> size_t ?
> ssize_t ?

This is a general C question, not a gcc question.  As such, it should
probably go to a mailing list about C, not to a mailing list
specifically about gcc.  Thanks.

The answer is that sizeof returns a value of type size_t.

> Where does size_t and ssize_t originate from ?  ANSI/stdio ?

I believe size_t was introduced in the ISO C90 standard.  I believe
that ssize_t was introduced in the second edition of the POSIX 1003.1
standard (1003.1-1996).

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-22 20:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-22 19:48 sizeof() return type ? Darryl Miles
2006-06-22 20:07 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).