Xref: utzoo comp.lang.c:22169 comp.unix.ultrix:1766 Path: utzoo!attcan!uunet!ginosko!aplcen!jhunix!doug From: doug@jhunix.HCF.JHU.EDU (Douglas W O'neal) Newsgroups: comp.lang.c,comp.unix.ultrix Subject: Re: Type of expression sizeof(x) Message-ID: <2619@jhunix.HCF.JHU.EDU> Date: 22 Sep 89 11:56:52 GMT References: <256@servio.UUCP> Reply-To: doug@jhunix.UUCP (Douglas W O'neal) Followup-To: comp.lang.c Organization: The Johns Hopkins University - HCF Lines: 20 In article <256@servio.UUCP> penneyj@servio.UUCP (D. Jason Penney) writes: > [ example deleted ] >It seems that the sizeof() is promoting the expression to be >unsigned. By the way, changing 3 to 3L does NOT make the problem disappear. > [...] >Our conversation with DEC re this bug was extremely unhelpful. They claim that >the return type of a sizeof() expression is system-dependent. Quoting from _The C Programming language_, 2nd edition, page 135: "Strictly, sizeof produces an unsigned integer value whose type, size_t, is defined in the header ." From this statement, I do not think that in is unreasonable for DEC to make sizeof of type unsigned since they are required for ANSI C to return a unsigned int. -- Doug O'Neal doug@jhuvms.hcf.jhu.edu Homewood Academic Computing doug@jhuvms.bitnet Johns Hopkins University mimsy!aplcen!jhunix!doug