This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sizeof() return type ?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]