home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.lang.c:16682 comp.std.c:3016
- Newsgroups: comp.lang.c,comp.std.c
- Path: sparky!uunet!blaze.cs.jhu.edu!rhombus!wilson
- From: wilson@rhombus.cs.jhu.edu (Dwight Wilson)
- Subject: Re: Idle Questions about ANSI C
- Message-ID: <1992Nov17.205344.20279@blaze.cs.jhu.edu>
- Followup-To: comp.std.c
- Sender: news@blaze.cs.jhu.edu (Usenet news system)
- Organization: The Johns Hopkins University CS Department
- References: <BxqBp1.5M6@netnews.jhuapl.edu> <1992Nov17.123803.6400@thunder.mcrcim.mcgill.edu> <1992Nov17.155826.15087@sq.sq.com>
- Date: Tue, 17 Nov 1992 20:53:44 GMT
- Lines: 27
-
-
- In article <1992Nov17.155826.15087@sq.sq.com> msb@sq.sq.com (Mark Brader) writes:
- >> > According to K+R 2nd ed, section A7.4.8, size_t is "an unsigned
- >> > integral constant; the particular type in implementation defined".
- >>
- >> Well, the result of sizeof is the quoted thing, and it notes that
- >> <stddef.h> defines the type in question as size_t.
- >>
- >> Now: is it required that size_t be the same as one of the four usual
- >> unsigned integral types? (How about ptrdiff_t?)
- >
- >The wording of section 3.1.2.5/6.1.2.5 of the standard clearly implies
- >that the 9 "usual" integral types are the only ones. They consist of
- >4 signed integer types, 4 unsigned integer types, and char -- which
- >of course can be either signed or unsigned. Since size_t and ptrdiff_t
- >are specified respectively as unsigned or signed *integral* types, not
- >*integer* types, then an implementation could actually use char for
- >one of them -- remember, it could be the same size as int or even long.
- >So there are 5 possibilities for each.
-
- To get nitpicky, section 3.3.3.4 states that size_t is an
- unsigned integral type. Section 3.1.2.5 discusses the integral
- types. As I read it, no matter what its implementation, char is
- neither an unsigned integral type nor a signed integral type. Thus,
- there are 4 possibilites for size_t and ptrdiff_t.
-
- -Dwight
-